Class AbstractFileOperationProvider

    • Field Detail

      • operations

        private final java.util.Collection<java.lang.Class<? extends FileOperation>> operations
        Available operations. Operations could be registered for different schemes. Some operations can work only for "file" scheme, other - for "svnhttp(s)", "svn", "svnssh", but not for "file", etc. The Map has scheme as a key and Collection of operations that are available for that scheme.
    • 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 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.
      • 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
        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:
        collectOperations(Collection operationsList, FileObject file)
      • instantiateOperation

        protected abstract FileOperation instantiateOperation​(FileObject file,
                                                              java.lang.Class<? extends FileOperation> operationClass)
                                                       throws FileSystemException
        Get operation instance for specified FileOperation subclass.
        Parameters:
        file - the file this operation should act on.
        operationClass - the class of an file operation interface to instantiate.
        Returns:
        a new file operation
        Throws:
        FileSystemException - if operation cannot be instantiated.
      • lookupOperation

        protected final java.lang.Class<? extends FileOperation> lookupOperation​(java.lang.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.
      • addOperation

        protected final void addOperation​(java.lang.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.