copyFile

This method copies the contents of the specified source file to the
specified destination file. The directory holding the destination file is
created if it does not exist. If the destination file exists, then this
method will overwrite it.

copyFile

This method copies the contents of the specified source file
to the specified destination file.
The directory holding the destination file is created if it does not exist.
If the destination file exists, then this method will overwrite it.

Parameters:

srcFile - an existing file to copy, must not be null

destFile - the new file, must not be null

preserveFileDate - true if the file date of the copy
should be the same as the original

copyFileToDirectory

This method copies the contents of the specified source file
to a file of the same name in the specified destination directory.
The destination directory is created if it does not exist.
If the destination file exists, then this method will overwrite it.

copyFileToDirectory

This method copies the contents of the specified source file
to a file of the same name in the specified destination directory.
The destination directory is created if it does not exist.
If the destination file exists, then this method will overwrite it.

Parameters:

srcFile - an existing file to copy, must not be null

destDir - the directory to place the copy in, must not be null

preserveFileDate - true if the file date of the copy
should be the same as the original

listFiles

Finds files within a given directory (and optionally its
subdirectories). All files found are filtered by an IOFileFilter.

If your search should recurse into subdirectories you can pass in
an IOFileFilter for directories. You don't need to bind a
DirectoryFileFilter (via logical AND) to this filter. This method does
that for you.

An example: If you want to search through all directories called
"temp" you pass in FileFilterUtils.NameFileFilter("temp")

Another common usage of this method is find files in a directory
tree but ignoring the directories generated CVS. You can simply pass
in FileFilterUtils.makeCVSAware(null).

Parameters:

directory - the directory to search in

fileFilter - filter to apply when finding files.

dirFilter - optional filter to apply when finding subdirectories.
If this parameter is null, subdirectories will not be included in the
search. Use TrueFileFilter.INSTANCE to match all directories.

openOutputStream

Opens a FileOutputStream for the specified file, checking and
creating the parent directory if it does not exist.

At the end of the method either the stream will be successfully opened,
or an exception will have been thrown.

The parent directory will be created if it does not exist.
The file will be created if it does not exist.
An exception is thrown if the file object exists but is a directory.
An exception is thrown if the file exists but cannot be written to.
An exception is thrown if the parent directory cannot be created.

touch

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.

NOTE: As from v1.3, this method throws an IOException if the last
modified date of the file cannot be set. Also, as from v1.3 this method
creates parent directories if they do not exist.