public abstract class AbstractFileOperationProvider extends Object implements FileOperationProvider
EMPTY_ARRAY
Constructor and Description |
---|
AbstractFileOperationProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
addOperation(Class<? extends FileOperation> operationClass)
Add new FileOperation to list of known operations.
|
void |
collectOperations(Collection<Class<? extends FileOperation>> operationsList,
FileObject file)
Gather available operations for the specified FileObject and put them into specified operationsList.
|
protected abstract void |
doCollectOperations(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.
|
FileOperation |
getOperation(FileObject file,
Class<? extends FileOperation> operationClass)
Get implementation for a given FileObject and FileOperation interface.
|
protected abstract FileOperation |
instantiateOperation(FileObject file,
Class<? extends FileOperation> operationClass)
Get operation instance for specified FileOperation subclass.
|
protected Class<? extends FileOperation> |
lookupOperation(Class<? extends FileOperation> operationClass)
Find class implementing a specific operation interface.
|
public final void collectOperations(Collection<Class<? extends FileOperation>> operationsList, FileObject file) throws FileSystemException
collectOperations
in interface FileOperationProvider
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.FileSystemException
- if list of operations cannot be retrieved.protected abstract void doCollectOperations(Collection<Class<? extends FileOperation>> availableOperations, Collection<Class<? extends FileOperation>> resultList, FileObject file) throws FileSystemException
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.FileSystemException
- if list of operations cannot be retrieved.collectOperations(Collection operationsList, FileObject file)
public final FileOperation getOperation(FileObject file, Class<? extends FileOperation> operationClass) throws FileSystemException
FileOperationProvider
getOperation
in interface FileOperationProvider
file
- the FileObject for which we need a operation.operationClass
- the Class which instance we are needed.FileSystemException
- if operation cannot be retrieved.protected abstract FileOperation instantiateOperation(FileObject file, Class<? extends FileOperation> operationClass) throws FileSystemException
file
- the file this operation should act on.operationClass
- the class of an file operation interface to instantiate.FileSystemException
- if operation cannot be instantiated.protected final Class<? extends FileOperation> lookupOperation(Class<? extends FileOperation> operationClass) throws FileSystemException
operationClass
- the interface which is requested.FileSystemException
- if operationClass is not a known FileOperation interface.protected final void addOperation(Class<? extends FileOperation> operationClass) throws FileSystemException
operationClass
- a class implementing FileOperation.FileSystemException
- if instances of the class cannot be assigned to FileOperation.Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.