Class AbstractFileOperationProvider
java.lang.Object
org.apache.commons.vfs2.operations.AbstractFileOperationProvider
- All Implemented Interfaces:
- FileOperationProvider
Abstracts implementations of 
FileOperationProvider.- Since:
- 0.1
- 
Field SummaryFields inherited from interface org.apache.commons.vfs2.operations.FileOperationProviderEMPTY_ARRAY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidaddOperation(Class<? extends FileOperation> operationClass) Add new FileOperation to list of known operations.final voidcollectOperations(Collection<Class<? extends FileOperation>> operationsList, FileObject file) Gather available operations for the specified FileObject and put them into specified operationsList.protected abstract voiddoCollectOperations(Collection<Class<? extends FileOperation>> availableOperations, Collection<Class<? extends FileOperation>> resultList, FileObject file) Gather available operations for the specified FileObject and put them into specified operationsList.final FileOperationgetOperation(FileObject file, Class<? extends FileOperation> operationClass) Gets implementation for a given FileObject and FileOperation interface.protected abstract FileOperationinstantiateOperation(FileObject file, Class<? extends FileOperation> operationClass) Gets operation instance for specified FileOperation subclass.protected final Class<? extends FileOperation> lookupOperation(Class<? extends FileOperation> operationClass) Find class implementing a specific operation interface.
- 
Constructor Details- 
AbstractFileOperationProviderpublic AbstractFileOperationProvider()Constructs a new instance for subclasses.
 
- 
- 
Method Details- 
addOperationprotected final void addOperation(Class<? extends FileOperation> operationClass) throws FileSystemException Add new FileOperation to list of known operations.- Parameters:
- operationClass- a class implementing FileOperation.
- Throws:
- FileSystemException- if instances of the class cannot be assigned to FileOperation.
 
- 
collectOperationspublic final void collectOperations(Collection<Class<? extends FileOperation>> operationsList, FileObject file) throws FileSystemException Gather available operations for the specified FileObject and put them into specified operationsList.- Specified by:
- collectOperationsin interface- FileOperationProvider
- Parameters:
- operationsList- the list of available operations for the specified 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 cannot be retrieved.
 
- 
doCollectOperationsprotected abstract void doCollectOperations(Collection<Class<? extends FileOperation>> availableOperations, Collection<Class<? extends FileOperation>> resultList, FileObject file) throws FileSystemException Gather available operations for the specified FileObject and put them into specified operationsList.- Parameters:
- availableOperations- the list of available operations for the specified FileObject.
- resultList- List to be filled with applicable operations.
- file- the FileObject for which we want to get the list of available operations.
- Throws:
- FileSystemException- if list of operations cannot be retrieved.
- See Also:
 
- 
getOperationpublic final FileOperation getOperation(FileObject file, Class<? extends FileOperation> operationClass) throws FileSystemException Description copied from interface:FileOperationProviderGets implementation for a given FileObject and FileOperation interface.- Specified by:
- getOperationin interface- FileOperationProvider
- Parameters:
- file- the FileObject for which we need an operation.
- operationClass- the Class which instance we are needed.
- Returns:
- the required operation instance.
- Throws:
- FileSystemException- if operation cannot be retrieved.
 
- 
instantiateOperationprotected abstract FileOperation instantiateOperation(FileObject file, Class<? extends FileOperation> operationClass) throws FileSystemException Gets operation instance for specified FileOperation subclass.- Parameters:
- file- the file this operation should act on.
- operationClass- the class of a file operation interface to instantiate.
- Returns:
- a new file operation
- Throws:
- FileSystemException- if operation cannot be instantiated.
 
- 
lookupOperationprotected final Class<? extends FileOperation> lookupOperation(Class<? extends FileOperation> operationClass) throws FileSystemException Find class implementing a specific operation interface.- Parameters:
- operationClass- the interface which is requested.
- Returns:
- never returns null
- Throws:
- FileSystemException- if operationClass is not a known FileOperation interface.
 
 
-