edu.uiuc.ndiipp.hubandspoke.utils
Class HaSFileUtils

java.lang.Object
  extended by edu.uiuc.ndiipp.hubandspoke.utils.HaSFileUtils

public class HaSFileUtils
extends java.lang.Object

Author:
cordial

Constructor Summary
HaSFileUtils()
           
 
Method Summary
static java.lang.String getBase64MD5(java.io.File f)
          Returns the Base64 encoded MD5 Checksum for specified file
static java.lang.String getBase64MD5(java.io.InputStream in)
          Returns the Base64 encoded MD5 Checksum for specified InputStream WARNING: This method closes the stream it is passed! If any further processing is required you must re-open the stream.
static java.io.File saveStreamToTempFile(java.io.InputStream is)
          Creates a temp file from the stream in the default system location.
static java.io.File saveStreamToTempFile(java.io.InputStream is, java.lang.String name)
          Creates a temp file from the stream in the default system location.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HaSFileUtils

public HaSFileUtils()
Method Detail

saveStreamToTempFile

public static java.io.File saveStreamToTempFile(java.io.InputStream is)
                                         throws java.io.IOException
Creates a temp file from the stream in the default system location. This DOES NOT set deleteOnExit() so be sure to call delete() explicitly.

Parameters:
is - -- InputStream
Returns:
File -- temp file
Throws:
java.io.IOException

saveStreamToTempFile

public static java.io.File saveStreamToTempFile(java.io.InputStream is,
                                                java.lang.String name)
                                         throws java.io.IOException
Creates a temp file from the stream in the default system location. This DOES NOT set deleteOnExit() so be sure to call delete() explicitly.

Parameters:
is - -- InputStream
name - -- String denoting what to call the temp file.
Returns:
File -- temp file
Throws:
java.io.IOException

getBase64MD5

public static java.lang.String getBase64MD5(java.io.File f)
                                     throws java.io.IOException
Returns the Base64 encoded MD5 Checksum for specified file

Parameters:
f - -- File
Returns:
String representing the date in the format specified by RFC 1123
Throws:
java.io.IOException

getBase64MD5

public static java.lang.String getBase64MD5(java.io.InputStream in)
                                     throws java.io.IOException
Returns the Base64 encoded MD5 Checksum for specified InputStream WARNING: This method closes the stream it is passed! If any further processing is required you must re-open the stream.

Parameters:
in - -- InputStream
Returns:
String representing the date in the format specified by RFC 1123
Throws:
java.io.IOException


Copyright © 2006, University of Illinois.