org.apache.commons.vfs2.operations
Class AbstractFileOperationProvider

java.lang.Object
  extended by org.apache.commons.vfs2.operations.AbstractFileOperationProvider
All Implemented Interfaces:
FileOperationProvider

public abstract class AbstractFileOperationProvider
extends java.lang.Object
implements FileOperationProvider

Since:
0.1
Author:
Commons VFS team

Constructor Summary
AbstractFileOperationProvider()
           
 
Method Summary
protected  void addOperation(java.lang.Class<? extends FileOperation> operationClass)
           
 void collectOperations(java.util.Collection<java.lang.Class<? extends FileOperation>> operationsList, FileObject file)
          Gather available operations for the specified FileObject and put them into specified operationsList.
protected abstract  void doCollectOperations(java.util.Collection<java.lang.Class<? extends FileOperation>> availableOperations, java.util.Collection<java.lang.Class<? extends FileOperation>> resultList, FileObject file)
           
 FileOperation getOperation(FileObject file, java.lang.Class<? extends FileOperation> operationClass)
           
protected abstract  FileOperation instantiateOperation(FileObject file, java.lang.Class<? extends FileOperation> operationClass)
           
protected  java.lang.Class<? extends FileOperation> lookupOperation(java.lang.Class<? extends FileOperation> operationClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFileOperationProvider

public AbstractFileOperationProvider()
Method Detail

collectOperations

public final void collectOperations(java.util.Collection<java.lang.Class<? extends FileOperation>> operationsList,
                                    FileObject file)
                             throws FileSystemException
Gather available operations for the specified FileObject and put them into specified operationsList.

Specified by:
collectOperations in interface FileOperationProvider
Parameters:
operationsList - the list of available operations for the specivied FileObject. The operationList contains classes of available operations, e.g. Class objects.
file - the FileObject for which we want to get the list of available operations.
Throws:
FileSystemException - if list of operations cannto be retrieved.

doCollectOperations

protected abstract void doCollectOperations(java.util.Collection<java.lang.Class<? extends FileOperation>> availableOperations,
                                            java.util.Collection<java.lang.Class<? extends FileOperation>> resultList,
                                            FileObject file)
                                     throws FileSystemException
Throws:
FileSystemException

getOperation

public final FileOperation getOperation(FileObject file,
                                        java.lang.Class<? extends FileOperation> operationClass)
                                 throws FileSystemException
Specified by:
getOperation in interface FileOperationProvider
Parameters:
file - the FileObject for which we need a operation.
operationClass - the Class which instance we are needed.
Returns:
the requried operation instance.
Throws:
FileSystemException - if operation cannot be retrieved.

instantiateOperation

protected abstract FileOperation instantiateOperation(FileObject file,
                                                      java.lang.Class<? extends FileOperation> operationClass)
                                               throws FileSystemException
Parameters:
operationClass -
Returns:
Throws:
FileSystemException

lookupOperation

protected final java.lang.Class<? extends FileOperation> lookupOperation(java.lang.Class<? extends FileOperation> operationClass)
                                                                  throws FileSystemException
Parameters:
operationClass -
Returns:
never returns null
Throws:
FileSystemException

addOperation

protected final void addOperation(java.lang.Class<? extends FileOperation> operationClass)
                           throws FileSystemException
Parameters:
operationClass -
Throws:
FileSystemException