| java.lang.Object org.columba.core.io.DiskIO
DiskIO | final public class DiskIO (Code) | | Utility methods for handling files and directories.
|
copyFile | public static void copyFile(File inputFile, File outputFile) throws java.io.IOException(Code) | | Copies the contents of any disk file to the specified output file. The
output file will be overridden if it exist. Function reports errors.
Parameters: inputFile - a File object Parameters: outputFile - a File object throws: java.io.IOException - if the function could not be completed because of an IO error |
copyResource | public static boolean copyResource(String resource, File outputFile) throws java.io.IOException(Code) | | Copies a system resource to the specified output file. The output file
will be overridden if it exist, so the calling routine has to take care
about unwanted deletions of content. Function reports errors.
Parameters: resource - a full resource path. If the value begins with "#", it isresolved against the program's standard resource folder afterremoving "#" true if and only if the operation was successful,false if the resource was not found throws: java.io.IOException - if there was an IO error |
copyResource | public static boolean copyResource(String resource, String outputFile) throws java.io.IOException(Code) | | Results equal
copyResource ( String resource, new File (outputFile) ) .
|
deleteDirectory | public static boolean deleteDirectory(File dir)(Code) | | Deletes the directory specified by the parameter and all of its contents.
This does recurse into subdirectories. Function reports errors. If the
parameter does not denote a directory, false is always returned.
Parameters: dir - a File representing the directory to be delete true if and only if the directory does not exist ontermination; a return value false does not imply thatthere were no files deleted throws: IllegalArgumentException - if the parameter is null |
emptyDirectory | public static boolean emptyDirectory(File dir)(Code) | | Deletes the contents of an existing directory. (May be applied to
non-existing files without causing error.)
true if and only if on termination the directory existsand is empty |
ensureDirectory | public static boolean ensureDirectory(File dir)(Code) | | Ensures the existence of the directory specified by the parameter. If the
directory does not exist, an attempt is performed to create it including
all necessary parent directories that may be implied by the
specification. ### HELPME : against what should a relative pathname be
made absolute? ### ### We need to set the installation directory
somewhere! ####
Parameters: dir - File specifying the intended directory name; if the specifiedname is a relative path, it is always made absolute againstthe program's installationDirectory . true if and only if the specified file exists and is adirectory |
ensureDirectory | public static boolean ensureDirectory(String path)(Code) | | |
getResourceStream | public static InputStream getResourceStream(String path) throws java.io.IOException(Code) | | General use columba resource InputStream getter.
Parameters: path - the full path and filename of the resource requested. Ifpath begins with "#" it is resolved against theprogram's standard resource folder after removing "#" an InputStream to read the resource data, or null if theresource could not be obtained throws: java.io.IOException - if there was an error opening the input stream |
getResourceURL | public static URL getResourceURL(String path)(Code) | | General use columba resource URL getter.
Parameters: path - the full path and filename of the resource requested. Ifpath begins with "#" it is resolved against theprogram's standard resource folder after removing "#" an URL instance, or null if the resource could not beobtained throws: java.io.IOException - if there was an error opening the input stream |
setResourceRoot | public static void setResourceRoot(String path)(Code) | | |
|
|