|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.cargo.util.DefaultFileHandler
public class DefaultFileHandler
File operations that are performed in Cargo. All file operations must use this class.
| Constructor Summary | |
|---|---|
DefaultFileHandler()
Initializations. |
|
| Method Summary | |
|---|---|
java.lang.String |
append(java.lang.String path,
java.lang.String suffixToAppend)
Append a suffix path to an existing path. |
void |
copy(java.io.InputStream in,
java.io.OutputStream out)
Copies data from an InputStream to an OutputStream using a default buffer size.. |
void |
copy(java.io.InputStream in,
java.io.OutputStream out,
int bufSize)
Copies data from an InputStream to an OutputStream. |
void |
copyDirectory(java.lang.String source,
java.lang.String target)
Copy a directory from a source to a destination. |
void |
copyDirectory(java.lang.String source,
java.lang.String target,
java.util.List excludes)
Copy a directory from a source to a destination specifying files to be excluded. |
void |
copyFile(java.lang.String source,
java.lang.String target)
Copy a file from a source to a destination specifying if source files may overwrite newer destination files. |
java.lang.String |
createDirectory(java.lang.String parentDir,
java.lang.String name)
Convenience method for creating a new directory inside another one. |
void |
createFile(java.lang.String file)
Create a file. |
java.lang.String |
createUniqueTmpDirectory()
Creates a unique temporary directory. |
void |
delete(java.lang.String path)
Deletes a file or directory, removing any children as appropriate. |
boolean |
exists(java.lang.String path)
|
java.lang.String[] |
getChildren(java.lang.String directory)
|
java.io.InputStream |
getInputStream(java.lang.String file)
|
java.lang.String |
getName(java.lang.String file)
|
java.io.OutputStream |
getOutputStream(java.lang.String file)
|
java.lang.String |
getParent(java.lang.String path)
|
java.lang.String |
getTmpPath(java.lang.String name)
Compute the location of a temporary directory. |
java.lang.String |
getURL(java.lang.String path)
|
boolean |
isDirectory(java.lang.String path)
|
boolean |
isDirectoryEmpty(java.lang.String dir)
|
void |
mkdirs(java.lang.String path)
Create directories for the passed path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFileHandler()
| Method Detail |
|---|
public void copyFile(java.lang.String source,
java.lang.String target)
copyFile in interface FileHandlersource - the file to copy from. Must not be null.target - the file to copy to. Must not be null.FileHandler.copyFile(String, String)
public void copyDirectory(java.lang.String source,
java.lang.String target)
copyDirectory in interface FileHandlersource - the directory to copy from. Must not be null.target - the directory to copy to. Must not be null.FileHandler.copyDirectory(String, String)
public void copyDirectory(java.lang.String source,
java.lang.String target,
java.util.List excludes)
copyDirectory in interface FileHandlersource - 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.FileHandler.copyDirectory(String, String)
public java.lang.String createDirectory(java.lang.String parentDir,
java.lang.String name)
createDirectory in interface FileHandlerparentDir - The directory in which the new directory should be createdname - The name of the directory to create
FileHandler.createDirectory(String, String)
public void copy(java.io.InputStream in,
java.io.OutputStream out,
int bufSize)
copy in interface FileHandlerin - InputStream to copy data fromout - OutputStream to copy data tobufSize - size of the copy bufferFileHandler.copy(java.io.InputStream, java.io.OutputStream, int)
public void copy(java.io.InputStream in,
java.io.OutputStream out)
copy in interface FileHandlerin - InputStream to copy data fromout - OutputStream to copy data toFileHandler.copy(java.io.InputStream, java.io.OutputStream, int)public java.lang.String getTmpPath(java.lang.String name)
getTmpPath in interface FileHandlername - The name of the directory to compute inside the tmp directory
FileHandler.getTmpPath(String)public java.lang.String createUniqueTmpDirectory()
createUniqueTmpDirectory in interface FileHandlerFileHandler.createUniqueTmpDirectory()public void delete(java.lang.String path)
delete in interface FileHandlerpath - the path to the file or directory to removeFileHandler.delete(String)public java.io.InputStream getInputStream(java.lang.String file)
getInputStream in interface FileHandlerfile - the file for which to get an InputStream for
FileHandler.getInputStream(String)public java.io.OutputStream getOutputStream(java.lang.String file)
getOutputStream in interface FileHandlerfile - the file for which to get an OutputStream for
FileHandler.getOutputStream(String)
public java.lang.String append(java.lang.String path,
java.lang.String suffixToAppend)
append in interface FileHandlerpath - the path to append tosuffixToAppend - the suffix to append to the path
FileHandler.append(String, String)public void mkdirs(java.lang.String path)
mkdirs in interface FileHandlerpath - the path for which to create all directories leading to itFileHandler.mkdirs(String)public java.lang.String getParent(java.lang.String path)
getParent in interface FileHandlerpath - the path for which to return its parent
FileHandler.getParent(String)public boolean exists(java.lang.String path)
exists in interface FileHandlerpath - the path to check the existence for
FileHandler.exists(String)public void createFile(java.lang.String file)
createFile in interface FileHandlerfile - the file to createFileHandler.createFile(String)public boolean isDirectoryEmpty(java.lang.String dir)
isDirectoryEmpty in interface FileHandlerdir - the directory to check
FileHandler.isDirectoryEmpty(String)public java.lang.String getName(java.lang.String file)
getName in interface FileHandlerfile - the file name for which to return the file name
FileHandler.getName(String)public java.lang.String getURL(java.lang.String path)
getURL in interface FileHandlerpath - the path for which to return the URL
FileHandler.getURL(String)public boolean isDirectory(java.lang.String path)
isDirectory in interface FileHandlerpath - the path to verify
FileHandler.isDirectory(String)public java.lang.String[] getChildren(java.lang.String directory)
getChildren in interface FileHandlerdirectory - the directory for which to return all children
FileHandler.getChildren(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||