|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jaulp.file.copy.CopyFileUtils
public class CopyFileUtils
The Class CopyFileUtils helps you to copy files or directories.
Constructor Summary | |
---|---|
CopyFileUtils()
|
Method Summary | |
---|---|
static boolean |
copyDirectory(java.io.File source,
java.io.File destination)
Copies the given source directory to the given destination directory. |
static boolean |
copyDirectory(java.io.File source,
java.io.File destination,
boolean lastModified)
Copies the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory. |
static boolean |
copyDirectoryWithFileFilter(java.io.File source,
java.io.File destination,
java.io.FileFilter fileFilter,
boolean lastModified)
Copies all files that match to the FileFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory. |
static boolean |
copyDirectoryWithFileFilters(java.io.File source,
java.io.File destination,
java.io.FileFilter includeFileFilter,
java.io.FileFilter excludeFileFilter,
boolean lastModified)
Copies all files that match to the given includeFileFilter and does not copy all the files that match the excludeFileFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory. |
static boolean |
copyDirectoryWithFilenameFilter(java.io.File source,
java.io.File destination,
java.io.FilenameFilter filenameFilter,
boolean lastModified)
Copies all files that match to the FilenameFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory. |
static boolean |
copyDirectoryWithFilenameFilters(java.io.File source,
java.io.File destination,
java.io.FilenameFilter includeFilenameFilter,
java.io.FilenameFilter excludeFilenameFilter,
boolean lastModified)
Copies all files that match to the given includeFilenameFilter and does not copy all the files that match the excludeFilenameFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory. |
static boolean |
copyFile(java.io.File source,
java.io.File destination)
Copies the given source file to the given destination file. |
static boolean |
copyFile(java.io.File source,
java.io.File destination,
boolean lastModified)
Copies the given source file to the given destination file with the option to set the lastModified time from the given destination file. |
static boolean |
copyFileToDirectory(java.io.File source,
java.io.File destinationDir)
Copies the given source file to the given destination directory. |
static boolean |
copyFileToDirectory(java.io.File source,
java.io.File destinationDir,
boolean lastModified)
Copies the given source file to the given destination directory with the option to set the lastModified time from the given destination directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CopyFileUtils()
Method Detail |
---|
public static boolean copyFile(java.io.File source, java.io.File destination) throws java.io.IOException, FileIsADirectoryException
source
- The source file.destination
- The destination file.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.public static boolean copyFile(java.io.File source, java.io.File destination, boolean lastModified) throws java.io.IOException, FileIsADirectoryException
source
- The source file.destination
- The destination file.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination file.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.public static boolean copyDirectory(java.io.File source, java.io.File destination) throws FileIsSecurityRestrictedException, java.io.IOException, FileIsADirectoryException, FileIsNotADirectoryException, DirectoryAllreadyExistsException
source
- The source directory.destination
- The destination directory.
FileIsSecurityRestrictedException
- Is thrown if the source file is security restricted.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
DirectoryAllreadyExistsException
- Is thrown if the directory all ready exists.public static boolean copyDirectory(java.io.File source, java.io.File destination, boolean lastModified) throws FileIsSecurityRestrictedException, java.io.IOException, FileIsADirectoryException, FileIsNotADirectoryException, DirectoryAllreadyExistsException
source
- The source directory.destination
- The destination directory.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination file.
FileIsSecurityRestrictedException
- Is thrown if the source file is security restricted.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
DirectoryAllreadyExistsException
- Is thrown if the directory all ready exists.public static boolean copyDirectoryWithFileFilter(java.io.File source, java.io.File destination, java.io.FileFilter fileFilter, boolean lastModified) throws java.io.IOException, FileIsNotADirectoryException, FileIsADirectoryException, FileIsSecurityRestrictedException, DirectoryAllreadyExistsException
source
- The source directory.destination
- The destination directory.fileFilter
- The FileFilter for the files to be copied. If null all files will be copied.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination file.
FileIsSecurityRestrictedException
- Is thrown if the source file is security restricted.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
DirectoryAllreadyExistsException
- Is thrown if the directory all ready exists.public static boolean copyDirectoryWithFileFilters(java.io.File source, java.io.File destination, java.io.FileFilter includeFileFilter, java.io.FileFilter excludeFileFilter, boolean lastModified) throws java.io.IOException, FileIsNotADirectoryException, FileIsADirectoryException, FileIsSecurityRestrictedException, DirectoryAllreadyExistsException
source
- The source directory.destination
- The destination directory.includeFileFilter
- The FileFilter for the files to be copied. If null all files will be copied.excludeFileFilter
- The FileFilter for the files to be not copied. If null no files will be excluded by copy process.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination file.
FileIsSecurityRestrictedException
- Is thrown if the source file is security restricted.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
DirectoryAllreadyExistsException
- Is thrown if the directory all ready exists.public static boolean copyDirectoryWithFilenameFilters(java.io.File source, java.io.File destination, java.io.FilenameFilter includeFilenameFilter, java.io.FilenameFilter excludeFilenameFilter, boolean lastModified) throws java.io.IOException, FileIsNotADirectoryException, FileIsADirectoryException, FileIsSecurityRestrictedException, DirectoryAllreadyExistsException
source
- The source directory.destination
- The destination directory.includeFilenameFilter
- The FilenameFilter for the files to be copied. If null all files will be copied.excludeFileFilter
- The FilenameFilter for the files to be not copied. If null no files will be excluded by copy process.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination file.
FileIsSecurityRestrictedException
- Is thrown if the source file is security restricted.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
DirectoryAllreadyExistsException
- Is thrown if the directory all ready exists.public static boolean copyDirectoryWithFilenameFilter(java.io.File source, java.io.File destination, java.io.FilenameFilter filenameFilter, boolean lastModified) throws java.io.IOException, FileIsNotADirectoryException, FileIsADirectoryException, FileIsSecurityRestrictedException, DirectoryAllreadyExistsException
source
- The source directory.destination
- The destination directory.filenameFilter
- The FilenameFilter for the files to be copied. If null all files will be copied.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination file.
FileIsSecurityRestrictedException
- Is thrown if the source file is security restricted.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
DirectoryAllreadyExistsException
- Is thrown if the directory all ready exists.public static boolean copyFileToDirectory(java.io.File source, java.io.File destinationDir) throws FileIsNotADirectoryException, java.io.IOException, FileIsADirectoryException
source
- The source file to copy in the destination directory.destinationDir
- The destination directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.public static boolean copyFileToDirectory(java.io.File source, java.io.File destinationDir, boolean lastModified) throws FileIsNotADirectoryException, java.io.IOException, FileIsADirectoryException
source
- The source directory.destinationDir
- The destination directory.lastModified
- Flag the tells if the attribute lastModified has to be set with the attribute from the destination directory.
FileIsNotADirectoryException
- Is thrown if the source file is not a directory.
java.io.IOException
- Is thrown if an error occurs by reading or writing.
FileIsADirectoryException
- Is thrown if the destination file is a directory.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |