public interface FileHandler
Modifier and Type | Method and Description |
---|---|
String |
append(String path,
String suffixToAppend)
Append a suffix path to an existing path.
|
void |
copy(InputStream in,
OutputStream out)
Copies data from an InputStream to an OutputStream using a default buffer size.
|
void |
copy(InputStream in,
OutputStream out,
int bufSize)
Copies data from an InputStream to an OutputStream.
|
void |
copyDirectory(String source,
String target)
Copy a directory from a source to a destination.
|
void |
copyDirectory(String source,
String target,
List excludes)
Copy a directory from a source to a destination specifying files to be excluded.
|
void |
copyFile(String source,
String target)
Copy a file from a source to a destination specifying if source files may overwrite newer
destination files.
|
String |
createDirectory(String parentDir,
String name)
Convenience method for creating a new directory inside another one.
|
void |
createFile(String file)
Create a file.
|
String |
createUniqueTmpDirectory()
Creates a unique temporary directory.
|
void |
delete(String path)
Deletes a file or directory, removing any children as appropriate.
|
boolean |
exists(String path) |
String[] |
getChildren(String directory) |
InputStream |
getInputStream(String file) |
String |
getName(String file) |
OutputStream |
getOutputStream(String file) |
String |
getParent(String path) |
String |
getTmpPath(String name)
Compute the location of a temporary directory.
|
String |
getURL(String path) |
boolean |
isDirectory(String path) |
boolean |
isDirectoryEmpty(String dir) |
void |
mkdirs(String path)
Create directories for the passed path.
|
void copyFile(String source, String target)
source
- the file to copy from. Must not be null
.target
- the file to copy to. Must not be null
.void copyDirectory(String source, String target)
source
- the directory to copy from. Must not be null
.target
- the directory to copy to. Must not be null
.void copyDirectory(String source, String target, List excludes)
source
- the directory to copy from. Must not be null
.target
- the directory to copy to. Must not be null
.excludes
- the list of files to be excluded. Each entry in the list is an
Ant file pattern.String createDirectory(String parentDir, String name)
parentDir
- The directory in which the new directory should be createdname
- The name of the directory to createvoid copy(InputStream in, OutputStream out, int bufSize)
in
- InputStream to copy data fromout
- OutputStream to copy data tobufSize
- size of the copy buffervoid copy(InputStream in, OutputStream out)
in
- InputStream to copy data fromout
- OutputStream to copy data toString getTmpPath(String name)
name
- The name of the directory to compute inside the tmp directoryString createUniqueTmpDirectory()
void delete(String path)
path
- the path to the file or directory to removeInputStream getInputStream(String file)
file
- the file for which to get an InputStream forOutputStream getOutputStream(String file)
file
- the file for which to get an OutputStream forString append(String path, String suffixToAppend)
path
- the path to append tosuffixToAppend
- the suffix to append to the pathvoid mkdirs(String path)
path
- the path for which to create all directories leading to itString getParent(String path)
path
- the path for which to return its parentboolean exists(String path)
path
- the path to check the existence forvoid createFile(String file)
file
- the file to createboolean isDirectoryEmpty(String dir)
dir
- the directory to checkboolean isDirectory(String path)
path
- the path to verifyString getName(String file)
file
- the file name for which to return the file nameString getURL(String path)
path
- the path for which to return the URLCopyright © 2004-2013 Codehaus. All Rights Reserved.