| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | copyDirectory(StorageFactory storageFactory, StorageFile from, File to, byte[] buffer, String[] filter, boolean copySubDirs)
|
| public static boolean | |
| public static boolean | copyDirectory(WritableStorageFactory storageFactory, File from, StorageFile to, byte[] buffer, String[] filter)
|
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static void | |
| private static boolean | Returns: true on success, or false if some of the
permissions could not be changedthe file to limit access to file)Limit access to owner using methods in the |
| private static boolean | Returns: true on success, or false if some of the
permissions could not be changedthe file to limit access to file)Limit access to owner using a
|
| public static boolean | Returns: true if the complete directory was removed, false if it could not be. If false is returned then some of the files in the directory may have been removed.The directory to remove directory)Remove a directory and all of its contents. |
| public static String | Returns: the stripped urlThe original url originalName)Remove the leading 'file://' protocol from a filename which has been expressed as an URL. |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| FileUtil | back to summary |
|---|---|
| public FileUtil() | |
| copyDirectory | back to summary |
|---|---|
| public static boolean copyDirectory(StorageFactory storageFactory, StorageFile from, File to, byte[] buffer, String[] filter, boolean copySubDirs) | |
| copyDirectory | back to summary |
|---|---|
| public static boolean copyDirectory(WritableStorageFactory storageFactory, File from, StorageFile to) | |
| copyDirectory | back to summary |
|---|---|
| public static boolean copyDirectory(WritableStorageFactory storageFactory, File from, StorageFile to, byte[] buffer, String[] filter) | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(File from, File to, byte[] buf) | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(StorageFactory storageFactory, StorageFile from, File to) | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(StorageFactory storageFactory, StorageFile from, File to, byte[] buf) | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(WritableStorageFactory storageFactory, File from, StorageFile to) | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(WritableStorageFactory storageFactory, File from, StorageFile to, byte[] buf) | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(WritableStorageFactory storageFactory, StorageFile from, StorageFile to) | |
| limitAccessToOwner | back to summary |
|---|---|
| public static void limitAccessToOwner(File file) throws IOException
Use when creating new files. If running on Unix,
limit read and write permissions on If the property is not specified, we use restrictive permissions anyway iff running with the server server started from the command line. On Unix, this is equivalent to running with umask 0077. On Windows, with FAT/FAT32, we lose, since the fs does not support permissions, only a read-only flag.
On Windows, with NTFS with ACLs, we limit access also for Windows
using the new
When restricted file access is enabled (either explicitly or by
default) errors are handled like this: When running on JDK 7 or higher,
and the file system can be accessed either via a PosixFileAttributeView
or via an AclFileAttributeView, any IOException reported when trying
to restrict the permissions will also be thrown by this method. In
all other cases, it will do its best to limit the permissions using
the
| |
| limitAccessToOwnerViaFile | back to summary |
|---|---|
| private static boolean limitAccessToOwnerViaFile(File file) Limit access to owner using methods in the
| |
| limitAccessToOwnerViaFileAttributeView | back to summary |
|---|---|
| private static boolean limitAccessToOwnerViaFileAttributeView(File file) throws IOException Limit access to owner using a
| |
| removeDirectory | back to summary |
|---|---|
| public static boolean removeDirectory(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.
| |
| stripProtocolFromFileName | back to summary |
|---|---|
| public static String stripProtocolFromFileName(String originalName) Remove the leading 'file://' protocol from a filename which has been expressed as an URL. If the filename is not an URL, then nothing is done. Otherwise, an URL like 'file:///tmp/foo.txt' is transformed into the legal file name '/tmp/foo.txt'. | |