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.
-
Constructor Summary
ConstructorsConstructorDescriptionPrivilegedFileReplicator
(FileReplicator replicator) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the replicator.void
init()
Initializes the component.replicateFile
(FileObject srcFile, FileSelector selector) Creates a local copy of the file, and all its descendants.void
setContext
(VfsComponentContext context) Sets the context for the replicator.void
setLogger
(org.apache.commons.logging.Log logger) Sets the Logger to use for the component.
-
Constructor Details
-
PrivilegedFileReplicator
Constructs a new instance.- Parameters:
replicator
- The replicator.
-
-
Method Details
-
close
Closes the replicator.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceVfsComponent
-
init
Initializes the component.- Specified by:
init
in interfaceVfsComponent
- Throws:
FileSystemException
- if an error occurs.
-
replicateFile
Creates a local copy of the file, and all its descendants.- Specified by:
replicateFile
in interfaceFileReplicator
- Parameters:
srcFile
- The source FileObject.selector
- The file selector.- Returns:
- The replicated file.
- Throws:
FileSystemException
- if an error occurs.
-
setContext
Sets the context for the replicator.- Specified by:
setContext
in interfaceVfsComponent
- Parameters:
context
- The component context.
-
setLogger
Sets the Logger to use for the component.- Specified by:
setLogger
in interfaceVfsComponent
- Parameters:
logger
- The logger.
-