public class DirectoryCopier extends Object
DirectoryScanner, mainly
to ensure we filter out "standard excludes" (like SCM dirs) but also to apply
any optional includes and/or excludes.| Constructor and Description |
|---|
DirectoryCopier(File sourceDirectory)
Instantiates a directory copier over the given source directory.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFileIfModified(File source,
File destination)
Copies the source file to the destination file.
|
void |
copyTo(File targetDirectory)
Copy contents of the
source directory to the given target directory. |
void |
copyTo(File targetDirectory,
String[] includes,
String[] excludes)
Copy contents of the
source directory to the given target directory. |
File |
getSourceDirectory()
Retrieve the source directory.
|
public DirectoryCopier(File sourceDirectory)
sourceDirectory - The directory from which to copy.public File getSourceDirectory()
public void copyTo(File targetDirectory) throws IOException
source directory to the given target directory.
Same as copy(targetDirectory,null,null)targetDirectory - The directory to which to copy the contentIOException - Indicates a problem performing the copy.public void copyTo(File targetDirectory, String[] includes, String[] excludes) throws IOException
source directory to the given target directory.
NOTE: the copier copies all content to the target directory except forAbstractScanner.addDefaultExcludes()targetDirectory - The directory to which to copy the matching contentincludes - Explicit inclusion match filename patterns.excludes - Explicit exclusion match filename patterns.IOException - Indicates a problem performing the copy.public static void copyFileIfModified(File source, File destination) throws IOException
source - The file to be copieddestination - The file to which to copy the source.IOException - Indicates a problem performing the copy.Copyright © 2009-2013 JBoss, a division of Red Hat, Inc. All Rights Reserved.