| java.lang.Object org.jfox.util.FileUtils
cleanDirectory | public static boolean cleanDirectory(File directory)(Code) | | Clean a directory without deleting it.
Parameters: directory - directory to clean |
delete | public static boolean delete(File file)(Code) | | Delete a file. If file is a directory, delete it and all
sub-directories.
The difference between File.delete() and this method are:
- A directory to be deleted does not have to be empty.
- You get exceptions when a file or directory cannot be deleted.
(java.io.File methods returns a boolean)
Parameters: file - file or directory to delete. |
deleteDirectory | public static boolean deleteDirectory(File dir)(Code) | | Delete a file, or a directory and all of its contents.
Parameters: dir - The directory or file to delete. True if all delete operations were successfull. |
deleteOnExit | public static void deleteOnExit(File file) throws IOException(Code) | | Schedule a file to be deleted when JVM exits. If file is directory delete
it and all sub-directories.
Parameters: file - file or directory to delete. throws: IOException - in case deletion is unsuccessful |
extractJar | public static void extractJar(File jarFile, File dest) throws IOException(Code) | | Dump the contents of a JarArchive to the dpecified destination.
|
getClassBytesMap | public static Map<String, byte[]> getClassBytesMap(URL location) throws IOException(Code) | | 获得一个 URL ä¸æ‰€æœ‰çš„Class Name
Parameters: location - url location throws: IOException - ioexception |
getClassBytesMap | public static Map<String, byte[]> getClassBytesMap(File file) throws IOException(Code) | | 从文件或目录ä¸æ?œç´¢æ‰€æœ‰çš„ class 文件
Parameters: file - file classname=>class bytes throws: IOException - ioexception |
getDescriptor | public static URL getDescriptor(URLClassLoader loader, String descriptorName)(Code) | | use URLClassLoader.findResource, this method will not find resource use
parent
Parameters: loader - Parameters: descriptorName - null if no such descriptor |
listFiles | public static List<File> listFiles(File dir, FileFilter filter)(Code) | | list Files recursively
Parameters: dir - directory Parameters: filter - file filter File list |
move | public static File move(File source, File dir) throws IOException(Code) | | move the source file to the targe directory
Parameters: source - Parameters: dir - |
toFile | public static File toFile(URL url)(Code) | | Convert from a URL to a File .
Parameters: url - File URL. The equivalent File object, or null if the URL's protocol is not file |
toURLs | public static URL[] toURLs(File[] files) throws IOException(Code) | | Convert the array of Files into a list of URLs.
Parameters: files - the array of files the array of URLs throws: IOException - if an error occurs |
touch | public static void touch(File file) throws IOException(Code) | | Implements the same behaviour as the "touch" utility on Unix. It creates
a new file with size 0 or, if the file exists already, it is opened and
closed without modifying it, but updating the file date and time.
Parameters: file - the File to touch throws: IOException - If an I/O problem occurs |
|
|