java.lang.Object
org.apache.derby.iapi.services.io.FileUtil
- public abstract class FileUtil
- extends java.lang.Object
A set of public static methods for dealing with File objects.
|
Method Summary |
static boolean |
copyDirectory(java.io.File from,
java.io.File to)
Copy a directory and all of its contents. |
static boolean |
copyDirectory(java.io.File from,
java.io.File to,
byte[] buffer,
java.lang.String[] filter)
|
static boolean |
copyDirectory(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to)
|
static boolean |
copyDirectory(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to,
byte[] buffer,
java.lang.String[] filter)
|
static boolean |
copyDirectory(java.lang.String from,
java.lang.String to)
|
static boolean |
copyDirectory(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to)
|
static boolean |
copyDirectory(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to,
byte[] buffer,
java.lang.String[] filter)
|
static boolean |
copyFile(java.io.File from,
java.io.File to)
|
static boolean |
copyFile(java.io.File from,
java.io.File to,
byte[] buf)
|
static boolean |
copyFile(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to)
|
static boolean |
copyFile(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to,
byte[] buf)
|
static boolean |
copyFile(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to)
|
static boolean |
copyFile(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to,
byte[] buf)
|
static java.io.File |
getAbsoluteFile(java.io.File root,
java.lang.String path)
Convert a file path into a File object with an absolute path
relative to a passed in root. |
static java.io.InputStream |
getInputStream(java.lang.String fileOrURL,
int bufferSize)
Open an input stream to read a file or a URL |
static java.io.File |
newFile(java.io.File parent,
java.lang.String name)
A replacement for new File(File, String) that correctly implements
the case when the first argument is null. |
static boolean |
removeDirectory(java.io.File directory)
Remove a directory and all of its contents. |
static boolean |
removeDirectory(java.lang.String directory)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUFFER_SIZE
private static final int BUFFER_SIZE
- See Also:
- Constant Field Values
FileUtil
public FileUtil()
removeDirectory
public static boolean removeDirectory(java.io.File directory)
- Remove a directory and all of its contents.
The results of executing File.delete() on a File object
that represents a directory seems to be platform
dependent. This method removes the directory
and all of its contents.
removeDirectory
public static boolean removeDirectory(java.lang.String directory)
copyDirectory
public static boolean copyDirectory(java.io.File from,
java.io.File to)
- Copy a directory and all of its contents.
copyDirectory
public static boolean copyDirectory(java.lang.String from,
java.lang.String to)
copyDirectory
public static boolean copyDirectory(java.io.File from,
java.io.File to,
byte[] buffer,
java.lang.String[] filter)
copyFile
public static boolean copyFile(java.io.File from,
java.io.File to)
copyFile
public static boolean copyFile(java.io.File from,
java.io.File to,
byte[] buf)
copyDirectory
public static boolean copyDirectory(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to)
copyDirectory
public static boolean copyDirectory(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to,
byte[] buffer,
java.lang.String[] filter)
copyFile
public static boolean copyFile(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to)
copyFile
public static boolean copyFile(org.apache.derby.io.StorageFactory storageFactory,
org.apache.derby.io.StorageFile from,
java.io.File to,
byte[] buf)
copyDirectory
public static boolean copyDirectory(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to)
copyDirectory
public static boolean copyDirectory(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to,
byte[] buffer,
java.lang.String[] filter)
copyFile
public static boolean copyFile(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to)
copyFile
public static boolean copyFile(org.apache.derby.io.WritableStorageFactory storageFactory,
java.io.File from,
org.apache.derby.io.StorageFile to,
byte[] buf)
getAbsoluteFile
public static java.io.File getAbsoluteFile(java.io.File root,
java.lang.String path)
- Convert a file path into a File object with an absolute path
relative to a passed in root. If path is absolute then
a file object constructed from new File(path) is returned,
otherwise a file object is returned from new File(root, path)
if root is not null, otherwise null is returned.
newFile
public static java.io.File newFile(java.io.File parent,
java.lang.String name)
- A replacement for new File(File, String) that correctly implements
the case when the first argument is null. The documentation for java.io.File
says that new File((File) null, name) is the same as new File(name).
This is not the case in pre 1.1.8 vms, a NullPointerException is thrown instead.
getInputStream
public static java.io.InputStream getInputStream(java.lang.String fileOrURL,
int bufferSize)
throws java.io.IOException
- Open an input stream to read a file or a URL