Class AbstractRemoteFileOperations

    • Constructor Detail

      • AbstractRemoteFileOperations

        public AbstractRemoteFileOperations()
    • Method Detail

      • copyFile

        protected abstract String copyFile​(String source,
                                           String target)
        Copies a file.
        Parameters:
        source - the source file
        target - the target file
        Returns:
        null if successful, otherwise error message
      • newRemoteDirectoryLister

        protected abstract DirectoryLister newRemoteDirectoryLister()
        Returns an instance of the remote directory lister.
        Returns:
        the directory lister
      • copyDir

        protected String copyDir​(String source,
                                 String target)
        Copies a directory.
        Parameters:
        source - the source dir
        target - the target dir
        Returns:
        null if successful, otherwise error message
      • copy

        public String copy​(String source,
                           String target)
        Copies a file/dir.
        Specified by:
        copy in interface FileOperations
        Parameters:
        source - the source file/dir
        target - the target file/dir
        Returns:
        null if successful, otherwise error message
      • duplicate

        public String duplicate​(String source,
                                String target)
        Duplicates a file/dir. Not implemented!
        Specified by:
        duplicate in interface FileOperations
        Parameters:
        source - the source file/dir
        target - the target file/dir
        Returns:
        null if successful, otherwise error message
      • renameLocal

        protected String renameLocal​(String source,
                                     String target)
        Renames a local file/dir.
        Parameters:
        source - the source file/dir (old)
        target - the target file/dir (new)
        Returns:
        null if successful, otherwise error message
      • renameRemote

        protected abstract String renameRemote​(String source,
                                               String target)
        Renames a remote file/dir.
        Parameters:
        source - the source file/dir (old)
        target - the target file/dir (new)
        Returns:
        null if successful, otherwise error message
      • rename

        public String rename​(String source,
                             String target)
        Renames a file/dir.
        Specified by:
        rename in interface FileOperations
        Parameters:
        source - the source file/dir (old)
        target - the target file/dir (new)
        Returns:
        null if successful, otherwise error message
      • move

        public String move​(String source,
                           String target)
        Moves a file/dir.
        Specified by:
        move in interface FileOperations
        Parameters:
        source - the source file/dir
        target - the target file/dir
        Returns:
        null if successful, otherwise error message
      • deleteLocal

        protected String deleteLocal​(String path)
        Deletes a local file/dir.
        Parameters:
        path - the file/dir to delete
        Returns:
        null if successful, otherwise error message
      • deleteRemote

        protected abstract String deleteRemote​(String path)
        Deletes a remote file/dir.
        Parameters:
        path - the file/dir to delete
        Returns:
        null if successful, otherwise error message
      • delete

        public String delete​(String path)
        Deletes a file/dir.
        Specified by:
        delete in interface FileOperations
        Parameters:
        path - the file/dir to delete
        Returns:
        null if successful, otherwise error message
      • mkdirLocal

        protected String mkdirLocal​(String dir)
        Creates the local directory.
        Parameters:
        dir - the directory to create
        Returns:
        null if successful, otherwise error message
      • mkdirRemote

        protected abstract String mkdirRemote​(String dir)
        Creates the remote directory.
        Parameters:
        dir - the directory to create
        Returns:
        null if successful, otherwise error message
      • mkdir

        public String mkdir​(String dir)
        Creates the directory.
        Specified by:
        mkdir in interface FileOperations
        Parameters:
        dir - the directory to create
        Returns:
        null if successful, otherwise error message
      • isDirLocal

        protected boolean isDirLocal​(String path)
        Checks whether the local path is a directory.
        Parameters:
        path - the path to check
        Returns:
        true if path exists and is a directory
      • isDirRemote

        protected abstract boolean isDirRemote​(String path)
        Checks whether the remote path is a directory.
        Parameters:
        path - the path to check
        Returns:
        true if path exists and is a directory
      • isDir

        public boolean isDir​(String path)
        Checks whether the path is a directory.
        Specified by:
        isDir in interface FileOperations
        Parameters:
        path - the path to check
        Returns:
        true if path exists and is a directory