public interface FileProcessor
Modifier and Type | Interface and Description |
---|---|
static interface |
FileProcessor.ProgressListener
A listener object that is notified for every progress made while copying files.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(java.io.File source,
java.io.File target)
Copies the specified source file to the given target file.
|
long |
copy(java.io.File source,
java.io.File target,
FileProcessor.ProgressListener listener)
Copies the specified source file to the given target file.
|
boolean |
mkdirs(java.io.File directory)
Creates the directory named by the given abstract pathname, including any necessary but nonexistent parent
directories.
|
void |
move(java.io.File source,
java.io.File target)
Moves the specified source file to the given target file.
|
java.lang.String |
readChecksum(java.io.File checksumFile)
Reads checksum from specified file.
|
void |
write(java.io.File target,
java.io.InputStream source)
Writes the given stream to a file.
|
void |
write(java.io.File target,
java.lang.String data)
Writes the given data to a file.
|
void |
writeChecksum(java.io.File checksumFile,
java.lang.String checksum)
Writes checksum to specified file.
|
boolean mkdirs(java.io.File directory)
directory
- The directory to create, may be null
.true
if and only if the directory was created, along with all necessary parent directories;
false
otherwisevoid write(java.io.File target, java.lang.String data) throws java.io.IOException
target
- The file to write to, must not be null
. This file will be overwritten.data
- The data to write, may be null
.java.io.IOException
- If an I/O error occurs.void write(java.io.File target, java.io.InputStream source) throws java.io.IOException
target
- The file to write to, must not be null
. This file will be overwritten.source
- The stream to write to the file, must not be null
.java.io.IOException
- If an I/O error occurs.void move(java.io.File source, java.io.File target) throws java.io.IOException
source
- The file to move from, must not be null
.target
- The file to move to, must not be null
.java.io.IOException
- If an I/O error occurs.void copy(java.io.File source, java.io.File target) throws java.io.IOException
source
- The file to copy from, must not be null
.target
- The file to copy to, must not be null
.java.io.IOException
- If an I/O error occurs.long copy(java.io.File source, java.io.File target, FileProcessor.ProgressListener listener) throws java.io.IOException
source
- The file to copy from, must not be null
.target
- The file to copy to, must not be null
.listener
- The listener to notify about the copy progress, may be null
.java.io.IOException
- If an I/O error occurs.java.lang.String readChecksum(java.io.File checksumFile) throws java.io.IOException
java.io.IOException
- in case of any IO error.void writeChecksum(java.io.File checksumFile, java.lang.String checksum) throws java.io.IOException
java.io.IOException
- in case of any IO error.