Package org.apache.commons.vfs2.impl
Class PrivilegedFileReplicator
java.lang.Object
org.apache.commons.vfs2.impl.PrivilegedFileReplicator
- All Implemented Interfaces:
Closeable,AutoCloseable,FileReplicator,VfsComponent
A file replicator that wraps another file replicator, performing the replication as a privileged action.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classAn action that closes the wrapped replicator.private classAn action that initializes the wrapped replicator.private classAn action that replicates a file using the wrapped replicator. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the replicator.voidinit()Initializes the component.replicateFile(FileObject srcFile, FileSelector selector) Creates a local copy of the file, and all its descendants.voidsetContext(VfsComponentContext context) Sets the context for the replicator.voidsetLogger(org.apache.commons.logging.Log logger) Sets the Logger to use for the component.
-
Field Details
-
replicator
-
replicatorComponent
-
-
Constructor Details
-
PrivilegedFileReplicator
-
-
Method Details
-
setLogger
public void setLogger(org.apache.commons.logging.Log logger) Sets the Logger to use for the component.- Specified by:
setLoggerin interfaceVfsComponent- Parameters:
logger- The logger.
-
setContext
Sets the context for the replicator.- Specified by:
setContextin interfaceVfsComponent- Parameters:
context- The component context.
-
init
Initializes the component.- Specified by:
initin interfaceVfsComponent- Throws:
FileSystemException- if an error occurs.
-
close
public void close()Closes the replicator.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVfsComponent
-
replicateFile
Creates a local copy of the file, and all its descendants.- Specified by:
replicateFilein interfaceFileReplicator- Parameters:
srcFile- The source FileObject.selector- The file selector.- Returns:
- The replicated file.
- Throws:
FileSystemException- if an error occurs.
-