|
![]() |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.autonomy.utilities.FileUtils
Library of function specifically for use with files
| Constructor Summary | |
FileUtils()
Constructor. |
|
| Method Summary | |
static void |
copyFile(java.io.File in,
java.io.File out)
Copies one file to another |
static void |
copyWithRecurse(java.io.File fileIn,
java.io.File fileDest)
Copies files and folders recursively |
static java.lang.String |
correctSeparators(java.lang.String sFile)
Takes a filename and makes sure the separators used in it are the system specific ones |
static java.lang.String |
ensureUniqueName(java.lang.String sFullPath)
Takes a full path to a file and adds numbers on to the end of it until the file does not exist. |
static java.lang.String |
readFileToString(java.lang.String sFileName)
Quick method to read the entire contents of a file into a String |
static void |
removeWithRecurse(java.io.File fileIn)
Deletes files and folders recursively |
static boolean |
writeInputStreamToFile(java.io.InputStream inputStream,
java.lang.String sFilename,
boolean bDeleteIfExists)
Takes the contents of an java.io.InputStream and writes to a file |
static boolean |
writeStringToFile(java.lang.String sInput,
java.lang.String sFilename,
boolean bDeleteIfExists)
Takes the contents of an String and writes to a file |
static boolean |
writeStringToFile(java.lang.String sInput,
java.lang.String sFilename,
java.lang.String sEncoding,
boolean bDeleteIfExists)
Takes the contents of an String and writes to a file |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileUtils()
| Method Detail |
public static void copyFile(java.io.File in,
java.io.File out)
throws java.lang.Exception
in - File to copyout - new File of destination
java.lang.Exceptionpublic static void removeWithRecurse(java.io.File fileIn)
fileIn - file object for folder or file
public static void copyWithRecurse(java.io.File fileIn,
java.io.File fileDest)
throws java.lang.Exception
fileIn - File object to copy from, usually a folderfileDest - File object for destination folder
java.lang.Exceptionpublic static java.lang.String correctSeparators(java.lang.String sFile)
sFile - Name of file to check
public static java.lang.String ensureUniqueName(java.lang.String sFullPath)
sFullPath - original full path.
public static java.lang.String readFileToString(java.lang.String sFileName)
sFileName - Full path to file to be read
public static boolean writeInputStreamToFile(java.io.InputStream inputStream,
java.lang.String sFilename,
boolean bDeleteIfExists)
inputStream - InputStream to read fromsFilename - Destination file to write tobDeleteIfExists - If true, will delete the file at the destination path
if it exists. If false, will append to destination file
public static boolean writeStringToFile(java.lang.String sInput,
java.lang.String sFilename,
java.lang.String sEncoding,
boolean bDeleteIfExists)
sInput - String to read fromsFilename - Destination file to write tosEncoding - Encoding used to write filebDeleteIfExists - If true, will delete the file at the destination path
if it exists. If false, will append to destination file
public static boolean writeStringToFile(java.lang.String sInput,
java.lang.String sFilename,
boolean bDeleteIfExists)
sInput - String to read fromsFilename - Destination file to write tobDeleteIfExists - If true, will delete the file at the destination path
if it exists. If false, will append to destination file
|
![]() |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||