org.apache.commons.vfs.impl
Class PrivilegedFileReplicator

java.lang.Object
  extended by org.apache.commons.vfs.impl.PrivilegedFileReplicator
All Implemented Interfaces:
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.

Version:
$Revision: 764356 $ $Date: 2009-04-13 06:06:01 +0200 (Mo, 13. Apr 2009) $
Author:
Adam Murdoch

Constructor Summary
PrivilegedFileReplicator(FileReplicator replicator)
           
 
Method Summary
 void close()
          Closes the replicator.
 void init()
          Initialises the component.
 java.io.File replicateFile(FileObject srcFile, FileSelector selector)
          Creates a local copy of the file, and all its descendents.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivilegedFileReplicator

public PrivilegedFileReplicator(FileReplicator replicator)
Method Detail

setLogger

public void setLogger(org.apache.commons.logging.Log logger)
Sets the Logger to use for the component.

Specified by:
setLogger in interface VfsComponent
Parameters:
logger - The logger.

setContext

public void setContext(VfsComponentContext context)
Sets the context for the replicator.

Specified by:
setContext in interface VfsComponent
Parameters:
context - The component context.

init

public void init()
          throws FileSystemException
Initialises the component.

Specified by:
init in interface VfsComponent
Throws:
FileSystemException - if an error occurs.

close

public void close()
Closes the replicator.

Specified by:
close in interface VfsComponent

replicateFile

public java.io.File replicateFile(FileObject srcFile,
                                  FileSelector selector)
                           throws FileSystemException
Creates a local copy of the file, and all its descendents.

Specified by:
replicateFile in interface FileReplicator
Parameters:
srcFile - The source FileObject.
selector - The file selector.
Returns:
The replicated file.
Throws:
FileSystemException - if an error occurs.


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.