org.mule.util
Class FileUtils
java.lang.Object
org.apache.commons.io.FileUtils
org.mule.util.FileUtils
- public class FileUtils
- extends FileUtils
FileUtils contains useful methods for dealing with files &
directories.
|
Method Summary |
static void |
copyStreamToFile(InputStream input,
File destination)
|
static File |
createFile(String filename)
|
static boolean |
deleteTree(File dir)
|
static String |
getResourcePath(String resourceName,
Class callingClass)
|
static String |
getResourcePath(String resourceName,
Class callingClass,
String encoding)
|
static File |
openDirectory(String directory)
|
static String |
prepareWinFilename(String filename)
|
static File |
stringToFile(String filename,
String data)
Reads the incoming String into a file at at the given destination. |
static File |
stringToFile(String filename,
String data,
boolean append)
|
static File |
stringToFile(String filename,
String data,
boolean append,
boolean newLine)
|
static void |
unzip(File archive,
File directory)
Unzip the specified archive to the given directory |
| Methods inherited from class org.apache.commons.io.FileUtils |
byteCountToDisplaySize, cleanDirectory, contentEquals, convertFileCollectionToFileArray, copyDirectory, copyDirectory, copyDirectoryToDirectory, copyFile, copyFile, copyFileToDirectory, copyURLToFile, deleteDirectory, forceDelete, forceDeleteOnExit, forceMkdir, isFileNewer, isFileNewer, isFileNewer, iterateFiles, iterateFiles, lineIterator, listFiles, listFiles, readFileToByteArray, readFileToString, readLines, sizeOfDirectory, toFile, toFiles, touch, toURLs, waitFor, writeByteArrayToFile, writeLines, writeLines, writeStringToFile |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtils
public FileUtils()
copyStreamToFile
public static void copyStreamToFile(InputStream input,
File destination)
throws IOException
- Throws:
IOException
createFile
public static File createFile(String filename)
throws IOException
- Throws:
IOException
prepareWinFilename
public static String prepareWinFilename(String filename)
openDirectory
public static File openDirectory(String directory)
throws IOException
- Throws:
IOException
stringToFile
public static File stringToFile(String filename,
String data)
throws IOException
- Reads the incoming String into a file at at the given destination.
- Parameters:
filename - name and path of the file to createdata - the contents of the file
- Returns:
- the new file.
- Throws:
IOException - If the creating or writing to the file stream fails
stringToFile
public static File stringToFile(String filename,
String data,
boolean append)
throws IOException
- Throws:
IOException
stringToFile
public static File stringToFile(String filename,
String data,
boolean append,
boolean newLine)
throws IOException
- Throws:
IOException
getResourcePath
public static String getResourcePath(String resourceName,
Class callingClass)
throws IOException
- Throws:
IOException
getResourcePath
public static String getResourcePath(String resourceName,
Class callingClass,
String encoding)
throws IOException
- Throws:
IOException
deleteTree
public static boolean deleteTree(File dir)
unzip
public static void unzip(File archive,
File directory)
throws IOException
- Unzip the specified archive to the given directory
- Throws:
IOException
Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.