public class FileCopyProcessor extends AFileProcessor
Constructor and Description |
---|
FileCopyProcessor(java.io.File targetFolder)
Initializes the new instance with a target folder.
|
Modifier and Type | Method and Description |
---|---|
protected java.io.File |
construcTargetFile(java.io.File file) |
protected FileUtil |
fileUtil() |
java.lang.Exception |
getException()
Returns the exception that occurred during file copying or null if
all was ok.
|
java.io.File |
getTargetFolder() |
protected void |
handleException(java.lang.Exception ex) |
boolean |
processFile(java.io.File file)
Copies the given file to the target folder.
|
protected void |
setTargetFolder(java.io.File folder) |
processObject
public FileCopyProcessor(java.io.File targetFolder)
targetFolder
- The folder to which the files must be copied.java.lang.IllegalArgumentException
- if the given target folder is no directory
or does not exist.public java.io.File getTargetFolder()
public java.lang.Exception getException()
public boolean processFile(java.io.File file)
getException()
method.processFile
in interface IFileProcessor
processFile
in class AFileProcessor
file
- The file or directory to processprotected java.io.File construcTargetFile(java.io.File file)
protected void setTargetFolder(java.io.File folder)
protected void handleException(java.lang.Exception ex)
protected FileUtil fileUtil()