Package org.apache.commons.vfs2.impl
Class PrivilegedFileReplicator
- java.lang.Object
-
- org.apache.commons.vfs2.impl.PrivilegedFileReplicator
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,FileReplicator,VfsComponent
public class PrivilegedFileReplicator extends java.lang.Object implements FileReplicator, VfsComponent
A file replicator that wraps another file replicator, performing the replication as a privileged action.
-
-
Constructor Summary
Constructors Constructor Description PrivilegedFileReplicator(FileReplicator replicator)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the replicator.voidinit()Initializes the component.java.io.FilereplicateFile(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.
-
-
-
Constructor Detail
-
PrivilegedFileReplicator
public PrivilegedFileReplicator(FileReplicator replicator)
Constructs a new instance.- Parameters:
replicator- The replicator.
-
-
Method Detail
-
close
public void close()
Closes the replicator.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceVfsComponent
-
init
public void init() throws FileSystemException
Initializes the component.- Specified by:
initin interfaceVfsComponent- Throws:
FileSystemException- if an error occurs.
-
replicateFile
public java.io.File replicateFile(FileObject srcFile, FileSelector selector) throws FileSystemException
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.
-
setContext
public void setContext(VfsComponentContext context)
Sets the context for the replicator.- Specified by:
setContextin interfaceVfsComponent- Parameters:
context- The component context.
-
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.
-
-