|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.util.FileUtils
fr.paris.lutece.maven.FileUtils
public class FileUtils
Utility class to manipulate files.
Note : these methods were copied from plexus-utils 1.2 because :
copyDirectoryStructureIfModified
;
Field Summary |
---|
Fields inherited from class org.codehaus.plexus.util.FileUtils |
---|
FS, ONE_GB, ONE_KB, ONE_MB |
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static void |
copyDirectoryStructure(java.io.File sourceDirectory,
java.io.File destinationDirectory)
Copies an entire directory structure. |
static void |
copyDirectoryStructureIfModified(java.io.File sourceDirectory,
java.io.File destinationDirectory)
Copies an entire directory structure but only source files with timestamp later than the destinations'. |
static void |
copyFile(java.io.File source,
java.io.File destination)
Copy file from source to destination. |
static void |
copyFileIfModified(java.io.File source,
java.io.File destination)
Copy file from source to destination only if source timestamp is later than the destination timestamp. |
static void |
copyFileToDirectoryIfModified(java.io.File source,
java.io.File destinationDirectory)
Copy file from source to destination only if source is newer than the target file. |
Methods inherited from class org.codehaus.plexus.util.FileUtils |
---|
basename, basename, byteCountToDisplaySize, catPath, cleanDirectory, cleanDirectory, contentEquals, copyDirectory, copyDirectory, copyFileToDirectory, copyFileToDirectory, copyURLToFile, createTempFile, deleteDirectory, deleteDirectory, dirname, extension, fileAppend, fileDelete, fileExists, filename, fileRead, fileRead, fileWrite, forceDelete, forceDelete, forceDeleteOnExit, forceMkdir, getDefaultExcludes, getDefaultExcludesAsList, getExtension, getFile, getFileNames, getFileNames, getFiles, getFiles, getFilesFromExtension, getPath, getPath, mkdir, normalize, removeExtension, removePath, removePath, rename, resolveFile, sizeOfDirectory, sizeOfDirectory, toFile, toURLs, waitFor, waitFor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtils()
Method Detail |
---|
public static void copyDirectoryStructureIfModified(java.io.File sourceDirectory, java.io.File destinationDirectory) throws java.io.IOException
sourceDirectory
must exists.
sourceDirectory
- the source directory.destinationDirectory
- the destination directory.
java.io.IOException
- if an I/O exception occurs.public static void copyDirectoryStructure(java.io.File sourceDirectory, java.io.File destinationDirectory) throws java.io.IOException
sourceDirectory
must exists.
sourceDirectory
- the source directory.destinationDirectory
- the destination directory.
java.io.IOException
- if an I/O exception occurs.public static void copyFileToDirectoryIfModified(java.io.File source, java.io.File destinationDirectory) throws java.io.IOException
destinationDirectory
does not exist, it
(and any parent directories) will be created. If a file
source
in destinationDirectory
exists, it
will be overwritten.
source
- An existing File
to copy.destinationDirectory
- A directory to copy source
into.
java.io.FileNotFoundException
- if source
isn't a normal file.
java.lang.IllegalArgumentException
- if destinationDirectory
isn't a directory.
java.io.IOException
- if source
does not exist, the file in
destinationDirectory
cannot be written to, or
an IO error occurs during copying.public static void copyFileIfModified(java.io.File source, java.io.File destination) throws java.io.IOException
destination
will be created if they don't already exist.
destination
will be overwritten if it already exists.
source
- An existing non-directory File
to copy bytes
from.destination
- A non-directory File
to write bytes to
(possibly overwriting).
java.io.IOException
- if source
does not exist,
destination
cannot be written to, or an IO
error occurs during copying.
java.io.FileNotFoundException
- if destination
is a directory (use
FileUtils.copyFileToDirectory(java.lang.String, java.lang.String)
).public static void copyFile(java.io.File source, java.io.File destination) throws java.io.IOException
destination
will be created if they don't already exist.
destination
will be overwritten if it already exists.
source
- An existing non-directory File
to copy bytes
from.destination
- A non-directory File
to write bytes to
(possibly overwriting).
java.io.IOException
- if source
does not exist,
destination
cannot be written to, or an IO
error occurs during copying.
java.io.FileNotFoundException
- if destination
is a directory (use
FileUtils.copyFileToDirectory(java.lang.String, java.lang.String)
).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |