|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.vfs.provider.AbstractVfsComponent
org.apache.commons.vfs.impl.DefaultFileReplicator
public class DefaultFileReplicator
A simple file replicator and temporary file store.
| Field Summary | |
|---|---|
private java.util.ArrayList |
copies
|
private long |
filecount
|
private static org.apache.commons.logging.Log |
log
|
private java.io.File |
tempDir
|
private boolean |
tempDirMessageLogged
|
private char[] |
TMP_RESERVED_CHARS
|
| Constructor Summary | |
|---|---|
DefaultFileReplicator()
|
|
DefaultFileReplicator(java.io.File tempDir)
constructor to set the location of the temporary directory |
|
| Method Summary | |
|---|---|
protected void |
addFile(java.lang.Object file)
|
java.io.File |
allocateFile(java.lang.String baseName)
Allocates a new temporary file. |
void |
close()
Closes the replicator, deleting all temporary files. |
protected java.io.File |
createAndAddFile(java.io.File parent,
java.lang.String basename)
|
protected java.io.File |
createFile(java.io.File parent,
java.lang.String name)
create the temporary file |
protected java.lang.String |
createFilename(java.lang.String baseName)
create the temporary file name |
protected void |
deleteFile(java.io.File file)
physically deletes the file from the filesystem |
protected long |
getFilecount()
|
void |
init()
Initialises this component. |
protected java.lang.Object |
removeFile()
removes a file from the copies list. |
protected void |
removeFile(java.lang.Object file)
removes a instance from the list of copies |
java.io.File |
replicateFile(FileObject srcFile,
FileSelector selector)
Creates a local copy of the file, and all its descendents. |
| Methods inherited from class org.apache.commons.vfs.provider.AbstractVfsComponent |
|---|
getContext, getLogger, setContext, setLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.apache.commons.logging.Log log
private final java.util.ArrayList copies
private java.io.File tempDir
private long filecount
private boolean tempDirMessageLogged
private char[] TMP_RESERVED_CHARS
| Constructor Detail |
|---|
public DefaultFileReplicator(java.io.File tempDir)
tempDir - public DefaultFileReplicator()
| Method Detail |
|---|
public void init()
throws FileSystemException
init in interface VfsComponentinit in class AbstractVfsComponentFileSystemExceptionpublic void close()
close in interface VfsComponentclose in class AbstractVfsComponentprotected void deleteFile(java.io.File file)
protected java.lang.Object removeFile()
protected void removeFile(java.lang.Object file)
public java.io.File allocateFile(java.lang.String baseName)
throws FileSystemException
allocateFile in interface TemporaryFileStorebaseName - The name of the file.
FileSystemException
protected java.io.File createAndAddFile(java.io.File parent,
java.lang.String basename)
throws FileSystemException
FileSystemExceptionprotected void addFile(java.lang.Object file)
protected long getFilecount()
protected java.lang.String createFilename(java.lang.String baseName)
protected java.io.File createFile(java.io.File parent,
java.lang.String name)
throws FileSystemException
FileSystemException
public java.io.File replicateFile(FileObject srcFile,
FileSelector selector)
throws FileSystemException
replicateFile in interface FileReplicatorsrcFile - The file to copy.selector - Selects the files to copy.
FileSystemException - If the source files does not exist, or on error copying.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||