public interface IOUtil
Modifier and Type | Field and Description |
---|---|
static String |
ROLE
Plexus component role.
|
Modifier and Type | Method and Description |
---|---|
void |
close(ZipFile closeable)
Silently closes the resource
|
void |
copyDirectoryStructure(File sourceDirectory,
File targetDirectory)
Copy directory structure from
sourceDirectory to targetDirectory . |
void |
copyFile(File sourceFile,
File targetFile) |
boolean |
copyFileToDirectoryIfNecessary(File sourceFile,
File targetDirectory)
Conditionally copy the file into the target directory.
|
void |
copyResources(File sourceDirectory,
File targetDirectory)
Copy the content of a directory to another one recursively.
|
void |
copyResources(URI uri,
ClassLoader classLoader,
File target)
Copy a resource from the given uri to
target file. |
void |
createArchive(File directory,
File archive) |
void |
deleteFile(File file)
Delete a file.
|
int |
deleteFiles(File directory,
FileFilter fileFilter) |
void |
makeDirectoryIfNecessary(File dir)
Create the given directory if it does not exist.
|
void |
removeDirectory(File dir)
Delete the specified directory.
|
void |
renameTo(File source,
File target)
Rename a file.
|
boolean |
shouldCopyFile(File sourceFile,
File targetFile) |
static final String ROLE
void copyResources(File sourceDirectory, File targetDirectory) throws org.apache.maven.plugin.MojoExecutionException
sourceDirectory
- directory to copytargetDirectory
- where to copyorg.apache.maven.plugin.MojoExecutionException
- if could not perform operationvoid copyDirectoryStructure(File sourceDirectory, File targetDirectory) throws org.apache.maven.plugin.MojoExecutionException
sourceDirectory
to targetDirectory
.sourceDirectory
- source of copytargetDirectory
- target of copyorg.apache.maven.plugin.MojoExecutionException
- if could not perform operationboolean shouldCopyFile(File sourceFile, File targetFile)
sourceFile
- source filetargetFile
- target filetrue
if source file should be copy to target locationboolean copyFileToDirectoryIfNecessary(File sourceFile, File targetDirectory) throws org.apache.maven.plugin.MojoExecutionException
sourceFile
name.sourceFile
- source file to copytargetDirectory
- location of the target directory where to copy filetrue
when the file was copied, false
otherwise.org.apache.maven.plugin.MojoExecutionException
- if an error occurs attempting to copy the file.void copyFile(File sourceFile, File targetFile) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
void removeDirectory(File dir) throws org.apache.maven.plugin.MojoExecutionException
dir
- the directory to deleteorg.apache.maven.plugin.MojoExecutionException
- if could not delete directoryvoid makeDirectoryIfNecessary(File dir) throws org.apache.maven.plugin.MojoExecutionException
dir
- the dir to create if it does not existorg.apache.maven.plugin.MojoExecutionException
- if could not create directoryint deleteFiles(File directory, FileFilter fileFilter) throws org.apache.maven.plugin.MojoExecutionException
directory
- location of directory where to delete some filesfileFilter
- filter to select files to deleteorg.apache.maven.plugin.MojoExecutionException
- if could not delete filesvoid deleteFile(File file) throws org.apache.maven.plugin.MojoExecutionException
file
- the file to deleteorg.apache.maven.plugin.MojoExecutionException
- if could not delete filevoid renameTo(File source, File target) throws org.apache.maven.plugin.MojoExecutionException
source
- original file to renmaetarget
- target fileorg.apache.maven.plugin.MojoExecutionException
- if could not rename filevoid copyResources(URI uri, ClassLoader classLoader, File target) throws org.apache.maven.plugin.MojoExecutionException
target
file.
The resource can come from class-path is the scheme is classpath
, otherwise will try to get incoming
resource from the url obtained from the uri.uri
- uri to copyclassLoader
- classloader used to find resource in from classpahttarget
- where to copyorg.apache.maven.plugin.MojoExecutionException
- if something wrong happenvoid close(ZipFile closeable)
closeable
- Copyright © 2005–2016 MojoHaus. All rights reserved.