| java.lang.Object com.bostechcorp.cbesb.common.util.FileUtil
FileUtil | public class FileUtil (Code) | | File utilities
version: $Revision: 383937 $ |
Field Summary | |
protected static transient Log | logger |
Method Summary | |
public static InputStream | String2InputStream(String str) | public static boolean | archiveContainsEntry(File theFile, String name) | public static boolean | buildDirectory(File file) | public static void | copy(File source, File dest) Fast & simple file copy. | public static void | copy(String from, String to) | public static boolean | copyFile(String from, String to) | public static void | copyFile(File oldFile, String newPath) | public static void | copyFiles(HashMap<String, String> map) | public static void | copyFilesRecursively(String sourceStringPath, String destinationStringPath, FileFilter filter) Copy File Resource from source to destination. | public static void | copyInputStream(InputStream in, OutputStream out) | public static synchronized File | createUniqueDirectory(File rootDir, String seed) | public static boolean | deleteFile(File fileToDelete) | public static File | getDirectoryPath(File parent, String subDirectory) | public static File | getFileFromClassPath(String name) | public static Collection<File> | listFiles(File directory, FileFilter filter, boolean recurse) | public static File[] | listFilesAsArray(File directory, FileFilter filter, boolean recurse) | public static void | moveFile(File src, File targetDirectory) | public static String | processLocationURI(String wsdlFixedURI, String relativeLocationURI) | public static byte[] | readBytes(InputStream inputStream) Parameters: inputStream - -to read from. | public static byte[] | readBytes(String fileInClassPath) Parameters: fileInClassPath - the filename in class path. | public static byte[] | readBytesFromFile(String filename) Parameters: filename - -filename to read. | public static String | readString(InputStream inputStream) Parameters: inputStream - -to read from. | public static String | readString(String fileInClassPath) Parameters: fileInClassPath - the filename in class path. | public static String | readStringFromFile(String filename) Parameters: filename - -filename to read. | public static File | unpackArchive(File theFile, File targetDir) | public static File | unpackArchive(URL url, File targetDir) | public static File | unpackArchiveCheckOverwrite(File theFile, File targetDir) | public static void | zipDir(String directory, String zipName) | public static void | zipDir(String directory, ZipOutputStream zos, String path) |
logger | protected static transient Log logger(Code) | | |
archiveContainsEntry | public static boolean archiveContainsEntry(File theFile, String name) throws IOException(Code) | | Validate that an archive contains a named entry
Parameters: theFile - Parameters: name - true if the entry exists throws: IOException - |
buildDirectory | public static boolean buildDirectory(File file)(Code) | | Build a directory path - creating directories if neccesary
Parameters: file - true if the directory exists, or making it was successful |
copyFile | public static boolean copyFile(String from, String to)(Code) | | Simple Copy "from" to "to"
Parameters: from - Parameters: to - Note: use fast copy from V1.2 |
copyFile | public static void copyFile(File oldFile, String newPath)(Code) | | Copy source(old) file to it's new location - newPath
Note: adapted to use fast Copy
Parameters: oldFile - Parameters: newPath - Note: use fast copy from V1.2 |
copyFilesRecursively | public static void copyFilesRecursively(String sourceStringPath, String destinationStringPath, FileFilter filter) throws FileNotFoundException, IOException(Code) | | Copy File Resource from source to destination. If the File resource is a
folder then it's content will be copyed recursively Note: Adapted to use
Fast Copy
Parameters: sourceStringPath - Parameters: destinationStringPath - Parameters: filter - -just in case you don't need all files throws: FileNotFoundException - throws: IOException - |
createUniqueDirectory | public static synchronized File createUniqueDirectory(File rootDir, String seed) throws IOException(Code) | | Create a unique directory within a directory 'root'
Parameters: rootDir - Parameters: seed - unique directory throws: IOException - |
deleteFile | public static boolean deleteFile(File fileToDelete)(Code) | | Delete a file
Parameters: fileToDelete - true if the File is deleted |
getDirectoryPath | public static File getDirectoryPath(File parent, String subDirectory)(Code) | | Build a path- but do not create it
Parameters: parent - Parameters: subDirectory - a File representing the path |
processLocationURI | public static String processLocationURI(String wsdlFixedURI, String relativeLocationURI)(Code) | | return Absolut URI, so the file can be accesed
Parameters: WsdlLocation - Parameters: relativeLocationURI - |
readBytes | public static byte[] readBytes(String fileInClassPath) throws IOException(Code) | | Parameters: fileInClassPath - the filename in class path. the bytes that were read from file. throws: IOException - |
readBytesFromFile | public static byte[] readBytesFromFile(String filename) throws IOException(Code) | | Parameters: filename - -filename to read. - the bytes that were read. throws: IOException - |
readString | public static String readString(String fileInClassPath) throws IOException(Code) | | Parameters: fileInClassPath - the filename in class path. the string that was read from file. throws: IOException - |
unpackArchive | public static File unpackArchive(URL url, File targetDir) throws IOException(Code) | | Unpack an archive from a URL
Parameters: url - Parameters: targetDir - the file to the url throws: IOException - |
unpackArchiveCheckOverwrite | public static File unpackArchiveCheckOverwrite(File theFile, File targetDir) throws IOException(Code) | | Unpack a zip file
Parameters: theFile - Parameters: targetDir - the file throws: IOException - |
|
|