|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.impl.DefaultFileReplicator
public class DefaultFileReplicator
A simple file replicator and temporary file store.
Constructor Summary | |
---|---|
DefaultFileReplicator()
|
|
DefaultFileReplicator(File tempDir)
constructor to set the location of the temporary directory. |
Method Summary | |
---|---|
protected void |
addFile(Object file)
|
File |
allocateFile(String baseName)
Allocates a new temporary file. |
void |
close()
Closes the replicator, deleting all temporary files. |
protected File |
createAndAddFile(File parent,
String basename)
|
protected File |
createFile(File parent,
String name)
create the temporary file |
protected String |
createFilename(String baseName)
create the temporary file name |
protected void |
deleteFile(File file)
physically deletes the file from the filesystem |
protected long |
getFilecount()
|
void |
init()
Initialises this component. |
protected Object |
removeFile()
removes a file from the copies list. |
protected void |
removeFile(Object file)
removes a instance from the list of copies |
File |
replicateFile(FileObject srcFile,
FileSelector selector)
Creates a local copy of the file, and all its descendents. |
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent |
---|
getContext, getLogger, setContext, setLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFileReplicator(File tempDir)
tempDir
- The temporary directory.public DefaultFileReplicator()
Method Detail |
---|
public void init() throws FileSystemException
init
in interface VfsComponent
init
in class AbstractVfsComponent
FileSystemException
- if an error occurs.public void close()
close
in interface VfsComponent
close
in class AbstractVfsComponent
protected void deleteFile(File file)
file
- The File to delete.protected Object removeFile()
protected void removeFile(Object file)
file
- The File to remove.public File allocateFile(String baseName) throws FileSystemException
allocateFile
in interface TemporaryFileStore
baseName
- the base file name.
FileSystemException
- if an error occurs.protected File createAndAddFile(File parent, String basename) throws FileSystemException
FileSystemException
protected void addFile(Object file)
protected long getFilecount()
protected String createFilename(String baseName)
baseName
- The base to prepend to the file name being created.
protected File createFile(File parent, String name) throws FileSystemException
parent
- The file to use as the parent of the file being created.name
- The name of the file to create.
FileSystemException
- if an error occurs creating the file.public File replicateFile(FileObject srcFile, FileSelector selector) throws FileSystemException
replicateFile
in interface FileReplicator
srcFile
- The file to copy.selector
- The FileSelector.
FileSystemException
- if an error occurs copying the file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |