|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.org.retep.util.io.FileUtils
public class FileUtils
Common methods used in our own binary file formats.
| Field Summary | |
|---|---|
static java.io.FileFilter |
DIRECTORY_FILTER
A FileFilter that will accept Directories that can be read |
static java.io.FileFilter |
EVERYTHING_FILTER
A FileFilter that will accept everything passed to it. |
static java.io.FileFilter |
FILE_FILTER
A FileFilter that will accept plain File's that can be read |
static java.io.FileFilter |
JAR_FILTER
A FileFilter that will accept plain File's that can be read and who's
name ends with .jar |
static java.io.FileFilter |
JAVA_FILTER
A FileFilter that will accept plain File's that can be read and who's
name ends with .java |
| Method Summary | ||
|---|---|---|
static void |
assertFileInsideDirectory(java.io.File baseDirectory,
java.io.File file)
Checks that the file is in the baseDirectory, or a subdirectory of it. |
|
static int |
copy(java.nio.channels.FileChannel src,
java.nio.channels.FileChannel dst)
Copy the content of one FileChannel to another |
|
static int |
copy(java.io.InputStream is,
java.io.OutputStream os)
Copy from a source InputStream and write to an OutputStream |
|
static int |
copy(java.io.Reader r,
java.io.Writer w)
Copy from a source InputStream and write to an OutputStream |
|
static int |
copyFile(java.io.File sourceFile,
java.io.File destinationFile)
Copy from one File and write to another |
|
static int |
copyFile(java.io.File file,
java.io.OutputStream os)
Copy from a File and write to an OutputStream |
|
static int |
copyFile(java.io.InputStream is,
java.io.File file)
Copy from a source InputStream and write to a File |
|
static boolean |
delete(java.io.File file)
Delete a File. |
|
static boolean |
delete(java.io.File file,
Log log)
Delete a File. |
|
static java.util.List<java.io.File> |
findFiles(java.io.File directory,
java.io.FileFilter filter,
boolean recurse)
|
|
static java.util.List<java.io.File> |
findFiles(java.io.FileFilter fileFilter,
java.util.List<java.io.File> sources)
Scan the list of sources returning all files that match the supplied FileFilter. |
|
static java.util.List<java.io.File> |
findFiles(java.util.List<java.io.File> files,
java.io.File directory,
java.io.FileFilter filter,
boolean recurse)
|
|
static
|
getComplexCopyFileVisitor(java.io.File destinationDirectory)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static
|
getComplexCopyFileVisitor(java.io.File destinationDirectory,
boolean overwrite)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static
|
getComplexCopyFileVisitor(Log log,
java.io.File destinationDirectory)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static
|
getComplexCopyFileVisitor(Log log,
java.io.File destinationDirectory,
boolean overwrite)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static
|
getComplexCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static
|
getComplexCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory,
boolean overwrite)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static
|
getComplexSetExecutableVisitor(boolean state)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static
|
getComplexSetExecutableVisitor(boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static
|
getComplexSetExecutableVisitor(Log log,
boolean state)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static
|
getComplexSetExecutableVisitor(Log log,
boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static
|
getComplexSetReadOnlyVisitor(boolean state)
A convenience method to get a FileVisitor to set the owner's read permission. |
|
static
|
getComplexSetReadOnlyVisitor(boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's read permission. |
|
static
|
getComplexSetReadOnlyVisitor(Log log,
boolean state)
A convenience method to get a FileVisitor to set the owner's read permission. |
|
static
|
getComplexSetReadOnlyVisitor(Log log,
boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static java.io.FileFilter |
getContentsFileFilter(java.io.File directory)
Returns a FileFilter which will include any file or directory that
is contained within the specified directory |
|
static FileVisitor |
getCopyFileVisitor(java.io.File destinationDirectory)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static FileVisitor |
getCopyFileVisitor(java.io.File destinationDirectory,
boolean overwrite)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static FileVisitor |
getCopyFileVisitor(Log log,
java.io.File destinationDirectory)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static FileVisitor |
getCopyFileVisitor(Log log,
java.io.File destinationDirectory,
boolean overwrite)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static FileVisitor |
getCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static FileVisitor |
getCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory,
boolean overwrite)
Create a FileVisitor what will copy the visited file to the destination directory. |
|
static java.io.FileFilter |
getExtensionFileFilter(java.lang.String fileExtension)
Returns a FileFilter which will accept all files whos names end
with a specific extension |
|
static FileVisitor |
getSetExecutableVisitor(boolean state)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetExecutableVisitor(boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetExecutableVisitor(Log log,
boolean state)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetExecutableVisitor(Log log,
boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetReadOnlyVisitor(boolean state)
A convenience method to get a FileVisitor to set the owner's read permission. |
|
static FileVisitor |
getSetReadOnlyVisitor(boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's read permission. |
|
static FileVisitor |
getSetReadOnlyVisitor(Log log,
boolean state)
A convenience method to get a FileVisitor to set the owner's read permission. |
|
static FileVisitor |
getSetReadOnlyVisitor(Log log,
boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetWritableVisitor(boolean state)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetWritableVisitor(boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetWritableVisitor(Log log,
boolean state)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static FileVisitor |
getSetWritableVisitor(Log log,
boolean state,
boolean ownerOnly)
A convenience method to get a FileVisitor to set the owner's execute permission. |
|
static java.io.File |
makeFileRelative(java.io.File baseDir,
java.io.File file)
Ensure that a File is relative from a base directory |
|
static java.io.File |
mkdir(java.io.File dir,
Log log)
Identical to File.mkdir() but will log if the logger is not null |
|
static java.io.File |
mkdirs(java.io.File dir,
Log log)
Identical to File.mkdir() but will log if the logger is not null |
|
static java.lang.StringBuilder |
read(java.io.File f)
|
|
static java.lang.StringBuilder |
read(java.io.File f,
java.lang.StringBuilder sb)
|
|
static java.lang.StringBuilder |
read(java.io.InputStream is)
|
|
static java.lang.StringBuilder |
read(java.io.InputStream is,
java.lang.StringBuilder sb)
|
|
static java.lang.StringBuilder |
read(java.io.Reader r)
|
|
static java.lang.StringBuilder |
read(java.io.Reader r,
java.lang.StringBuilder sb)
|
|
static byte[] |
readBytes(java.io.File file)
Read the content of a file into a byte array |
|
static byte[] |
readBytes(java.io.InputStream is)
Read the content of an InputStream into a byte array |
|
static java.util.List<java.lang.String> |
readLines(BufferedCharReader r)
|
|
static java.util.List<java.lang.String> |
readLines(BufferedCharReader r,
java.util.List<java.lang.String> list)
|
|
static java.util.List<java.lang.String> |
readLines(java.io.File f)
|
|
static java.util.List<java.lang.String> |
readLines(java.io.File f,
java.util.List<java.lang.String> list)
|
|
static java.util.List<java.lang.String> |
readLines(java.io.InputStream is)
|
|
static java.util.List<java.lang.String> |
readLines(java.io.InputStream is,
java.util.List<java.lang.String> list)
|
|
static java.util.List<java.lang.String> |
readLines(java.io.Reader r)
|
|
static java.util.List<java.lang.String> |
readLines(java.io.Reader r,
java.util.List<java.lang.String> list)
|
|
static java.util.List<java.io.File> |
scanFiles(java.io.FileFilter fileFilter,
java.util.List<java.lang.String> sources)
Scan the list of sources returning all files that match the supplied FileFilter. |
|
static java.util.List<java.io.File> |
scanFiles(java.io.FileFilter fileFilter,
java.lang.String... sources)
Scan the list of sources returning all files that match the supplied FileFilter. |
|
static java.util.List<java.net.URL> |
toURL(java.util.Collection<java.io.File> files)
|
|
static java.net.URL[] |
toURL(java.io.File... files)
|
|
static java.net.URL[] |
toURLArray(java.util.Collection<java.io.File> files)
|
|
static int |
transferFrom(java.io.File sourceFile,
java.nio.channels.WritableByteChannel dst)
Copy the content of a ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF. |
|
static int |
transferFrom(java.io.File sourceFile,
java.nio.channels.WritableByteChannel dst,
int bufferSize)
Copy the content of a ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF. |
|
static int |
transferFrom(java.nio.channels.ReadableByteChannel src,
java.nio.channels.WritableByteChannel dst)
Copy the content of a ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF. |
|
static int |
transferFrom(java.nio.channels.ReadableByteChannel src,
java.nio.channels.WritableByteChannel dst,
int bufferSize)
Copy the content of a ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF. |
|
static boolean |
visitFiles(ComplexFileVisitor visitor,
java.util.Collection<ComplexFile> files)
Run a FileVisitor over the supplied files. |
|
static boolean |
visitFiles(ComplexFileVisitor visitor,
java.util.Collection<ComplexFile> files,
boolean allModified)
Run a FileVisitor over the supplied files. |
|
static boolean |
visitFiles(FileVisitor visitor,
java.util.Collection<java.io.File> files)
Run a FileVisitor over the supplied files. |
|
static boolean |
visitFiles(FileVisitor visitor,
java.util.Collection<java.io.File> files,
boolean allModified)
Run a FileVisitor over the supplied files. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.io.FileFilter DIRECTORY_FILTER
FileFilter that will accept Directories that can be read
public static final java.io.FileFilter FILE_FILTER
FileFilter that will accept plain File's that can be read
public static final java.io.FileFilter JAVA_FILTER
FileFilter that will accept plain File's that can be read and who's
name ends with .java
public static final java.io.FileFilter JAR_FILTER
FileFilter that will accept plain File's that can be read and who's
name ends with .jar
public static final java.io.FileFilter EVERYTHING_FILTER
FileFilter that will accept everything passed to it. Useful for use
with API's that require a FileFilter.
The only thing this FileFilter will not accept is a null File.
| Method Detail |
|---|
public static final java.io.FileFilter getExtensionFileFilter(java.lang.String fileExtension)
FileFilter which will accept all files whos names end
with a specific extension
fileExtension - File extension. If it does not start with '.' then
one will be added to it
public static java.io.FileFilter getContentsFileFilter(java.io.File directory)
throws java.io.IOException
FileFilter which will include any file or directory that
is contained within the specified directory
directory - File of directory to include
FileFilter
java.io.IOException
public static java.io.File makeFileRelative(java.io.File baseDir,
java.io.File file)
throws java.io.IOException
baseDir - File representing the base directoryfile - File to make relative
java.io.IOException - if a canonical path cannot be found
java.lang.IllegalArgumentException - if file is not beneath baseDir
public static java.net.URL[] toURL(java.io.File... files)
throws java.net.MalformedURLException
java.net.MalformedURLException
public static java.net.URL[] toURLArray(java.util.Collection<java.io.File> files)
throws java.net.MalformedURLException
java.net.MalformedURLException
public static java.util.List<java.net.URL> toURL(java.util.Collection<java.io.File> files)
throws java.net.MalformedURLException
java.net.MalformedURLException
public static byte[] readBytes(java.io.File file)
throws java.io.IOException
file - File to read
java.io.IOException - on error
public static byte[] readBytes(java.io.InputStream is)
throws java.io.IOException
is - InputStream to read from
java.io.IOException - on error
public static final int copyFile(java.io.File sourceFile,
java.io.File destinationFile)
throws java.io.IOException
sourceFile - File to read fromdestinationFile - File to write to
java.io.IOException
public static final int copy(java.nio.channels.FileChannel src,
java.nio.channels.FileChannel dst)
throws java.io.IOException
src - source FileChanneldst - destination FileChannel
java.io.IOException
public static final int transferFrom(java.io.File sourceFile,
java.nio.channels.WritableByteChannel dst)
throws java.io.IOException
ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF. This method uses
a transfer block size of 100K
sourceFile - File to read fromdst - destination
java.io.IOException#transferFrom(java.nio.channels.ReadableByteChannel, java.nio.channels.WritableByteChannel, long)
public static final int transferFrom(java.io.File sourceFile,
java.nio.channels.WritableByteChannel dst,
int bufferSize)
throws java.io.IOException
ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF.
sourceFile - File to read fromdst - destinationbufferSize - The buffer size to use
java.io.IOException
public static final int transferFrom(java.nio.channels.ReadableByteChannel src,
java.nio.channels.WritableByteChannel dst)
throws java.io.IOException
ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF. This method uses
a transfer block size of 100K
src - sourcedst - destination
java.io.IOException#transferFrom(java.nio.channels.ReadableByteChannel, java.nio.channels.WritableByteChannel, long)
public static final int transferFrom(java.nio.channels.ReadableByteChannel src,
java.nio.channels.WritableByteChannel dst,
int bufferSize)
throws java.io.IOException
ReadableByteChannel and write to a
WritableByteChannel until the source returns EOF.
src - sourcedst - destinationbufferSize - The buffer size to use. If this is < 1K then the
default bufferSize of 100K will be used.
java.io.IOException
public static final int copyFile(java.io.File file,
java.io.OutputStream os)
throws java.io.IOException
file - File to read fromos - OutputStream
java.io.IOException
public static final int copyFile(java.io.InputStream is,
java.io.File file)
throws java.io.IOException
is - InputStreamfile - File to write to
java.io.IOException
public static final int copy(java.io.InputStream is,
java.io.OutputStream os)
throws java.io.IOException
is - InputStreamos - OutputStream
java.io.IOException
public static final int copy(java.io.Reader r,
java.io.Writer w)
throws java.io.IOException
r - Readerw - Writer
java.io.IOException
public static final java.lang.StringBuilder read(java.io.File f)
throws java.io.IOException
java.io.IOException
public static final java.lang.StringBuilder read(java.io.File f,
java.lang.StringBuilder sb)
throws java.io.IOException
java.io.IOException
public static final java.lang.StringBuilder read(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static final java.lang.StringBuilder read(java.io.Reader r)
throws java.io.IOException
java.io.IOException
public static final java.lang.StringBuilder read(java.io.InputStream is,
java.lang.StringBuilder sb)
throws java.io.IOException
java.io.IOException
public static final java.lang.StringBuilder read(java.io.Reader r,
java.lang.StringBuilder sb)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(java.io.File f)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(java.io.File f,
java.util.List<java.lang.String> list)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(java.io.Reader r)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(java.io.InputStream is,
java.util.List<java.lang.String> list)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(java.io.Reader r,
java.util.List<java.lang.String> list)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(BufferedCharReader r)
throws java.io.IOException
java.io.IOException
public static final java.util.List<java.lang.String> readLines(BufferedCharReader r,
java.util.List<java.lang.String> list)
throws java.io.IOException
java.io.IOException
public static java.util.List<java.io.File> findFiles(java.io.File directory,
java.io.FileFilter filter,
boolean recurse)
public static java.util.List<java.io.File> findFiles(java.util.List<java.io.File> files,
java.io.File directory,
java.io.FileFilter filter,
boolean recurse)
public static void assertFileInsideDirectory(java.io.File baseDirectory,
java.io.File file)
baseDirectory - File defining the base directoryfile - File to test
java.lang.SecurityException - if the file is outside the baseDirectory
public static java.io.File mkdir(java.io.File dir,
Log log)
dir - Directory to makelog - Log to use if not null
public static java.io.File mkdirs(java.io.File dir,
Log log)
dir - Directory to makelog - Log to use if not null
public static boolean visitFiles(FileVisitor visitor,
java.util.Collection<java.io.File> files)
throws java.io.IOException
visitor - FileVisitorfiles - List of File's to visit
java.io.IOException - if an error occurs.
public static boolean visitFiles(FileVisitor visitor,
java.util.Collection<java.io.File> files,
boolean allModified)
throws java.io.IOException
visitor - FileVisitorfiles - List of File's to visitallModified - the logical operation performed to generate the return
java.io.IOException - if an error occurs.
public static boolean visitFiles(ComplexFileVisitor visitor,
java.util.Collection<ComplexFile> files)
throws java.io.IOException
visitor - FileVisitorfiles - List of File's to visit
java.io.IOException - if an error occurs.
public static boolean visitFiles(ComplexFileVisitor visitor,
java.util.Collection<ComplexFile> files,
boolean allModified)
throws java.io.IOException
visitor - FileVisitorfiles - List of File's to visitallModified - the logical operation performed to generate the return
java.io.IOException - if an error occurs.
public static java.util.List<java.io.File> scanFiles(java.io.FileFilter fileFilter,
java.lang.String... sources)
sources - List of sources, may not be nullfileFilter - FileFilter, may not be null
public static java.util.List<java.io.File> scanFiles(java.io.FileFilter fileFilter,
java.util.List<java.lang.String> sources)
sources - List of sources, may not be nullfileFilter - FileFilter, may not be null
public static java.util.List<java.io.File> findFiles(java.io.FileFilter fileFilter,
java.util.List<java.io.File> sources)
sources - List of sources, may not be nullfileFilter - FileFilter, may not be null
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetExecutableVisitor(boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
F - ComplexFile implementationstate - true to set executable, false to clear
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetExecutableVisitor(boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
F - ComplexFile implementationstate - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetExecutableVisitor(Log log,
boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
F - ComplexFile implementationlog - Log to use, ignored if nullstate - true to set executable, false to clear
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetExecutableVisitor(Log log,
boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
F - ComplexFile implementationlog - Log to use, ignored if nullstate - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getSetExecutableVisitor(boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clear
public static FileVisitor getSetExecutableVisitor(boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getSetExecutableVisitor(Log log,
boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clear
public static FileVisitor getSetExecutableVisitor(Log log,
boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetReadOnlyVisitor(boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clear
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetReadOnlyVisitor(boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetReadOnlyVisitor(Log log,
boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clear
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexSetReadOnlyVisitor(Log log,
boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getSetReadOnlyVisitor(boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clear
public static FileVisitor getSetReadOnlyVisitor(boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getSetReadOnlyVisitor(Log log,
boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clear
public static FileVisitor getSetReadOnlyVisitor(Log log,
boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getSetWritableVisitor(boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clear
public static FileVisitor getSetWritableVisitor(boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
state - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getSetWritableVisitor(Log log,
boolean state)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clear
public static FileVisitor getSetWritableVisitor(Log log,
boolean state,
boolean ownerOnly)
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation
getSetExecutableVisitor(arg, true)
log - Log to use, ignored if nullstate - true to set executable, false to clearownerOnly - If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody. If the
underlying file system can not distinguish the owner's execute permission
from that of others, then the permission will apply to everybody,
regardless of this value.
public static FileVisitor getCopyFileVisitor(java.io.File destinationDirectory)
destinationDirectory - File of destinationDirectory
public static FileVisitor getCopyFileVisitor(java.io.File destinationDirectory,
boolean overwrite)
destinationDirectory - File of destinationDirectoryoverwrite - true to overwrite existing files
public static FileVisitor getCopyFileVisitor(Log log,
java.io.File destinationDirectory)
log - Optional LogdestinationDirectory - File of destinationDirectory
public static FileVisitor getCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory)
log - Optional Logmessage - Message to log per file if log != nulldestinationDirectory - File of destinationDirectory
public static FileVisitor getCopyFileVisitor(Log log,
java.io.File destinationDirectory,
boolean overwrite)
log - Optional LogdestinationDirectory - File of destinationDirectoryoverwrite - true to overwrite existing files
public static FileVisitor getCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory,
boolean overwrite)
log - Optional Logmessage - Message to log per file if log != nulldestinationDirectory - File of destinationDirectoryoverwrite - true to overwrite existing files
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexCopyFileVisitor(java.io.File destinationDirectory)
F - ComplexFile implementationdestinationDirectory - File of destinationDirectory
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexCopyFileVisitor(java.io.File destinationDirectory,
boolean overwrite)
F - ComplexFile implementationdestinationDirectory - File of destinationDirectoryoverwrite - true to overwrite existing files
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexCopyFileVisitor(Log log,
java.io.File destinationDirectory)
F - ComplexFile implementationlog - Optional LogdestinationDirectory - File of destinationDirectory
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory)
F - ComplexFile implementationlog - Optional Logmessage - Message to log per file if log != nulldestinationDirectory - File of destinationDirectory
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexCopyFileVisitor(Log log,
java.io.File destinationDirectory,
boolean overwrite)
F - ComplexFile implementationlog - Optional LogdestinationDirectory - File of destinationDirectoryoverwrite - true to overwrite existing files
public static <F extends ComplexFile> ComplexFileVisitor<F> getComplexCopyFileVisitor(Log log,
java.lang.String message,
java.io.File destinationDirectory,
boolean overwrite)
F - ComplexFile implementationlog - Optional Logmessage - Message to log per file if log != nulldestinationDirectory - File of destinationDirectoryoverwrite - true to overwrite existing files
public static boolean delete(@Nonnull
java.io.File file)
File.delete() except that
this method will delete all content if it's a directory
file - File to delete
public static boolean delete(@Nonnull
java.io.File file,
@Nullable
Log log)
File.delete() except that
this method will delete all content if it's a directory
file - File to deletelog - Log to log progress to, null for no logging
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||