Class SftpFileOperations

    • Constructor Detail

      • SftpFileOperations

        public SftpFileOperations()
    • Method Detail

      • setProvider

        public void setProvider​(SSHSessionProvider value)
        Sets the SSH session provider to use.
        Parameters:
        value - the provider
      • getProvider

        public SSHSessionProvider getProvider()
        Returns the SSH session provider in use.
        Returns:
        the provider, null if none set
      • isSupported

        public boolean isSupported​(Operation op)
        Checks whether the given operation is supported.
        Parameters:
        op - the operation to check
        Returns:
        true if supported
      • renameRemote

        protected String renameRemote​(String source,
                                      String target)
        Renames a remote file/dir.
        Specified by:
        renameRemote in class AbstractRemoteFileOperations
        Parameters:
        source - the source file/dir (old)
        target - the target file/dir (new)
        Returns:
        null if successful, otherwise error message
      • deleteRemoteDir

        protected String deleteRemoteDir​(com.jcraft.jsch.ChannelSftp channel,
                                         String path)
        Deletes a remote dir. Must be empty.
        Parameters:
        channel - the channel to use
        path - the file/dir to delete
        Returns:
        null if successful, otherwise error message
      • deleteRemoteFile

        protected String deleteRemoteFile​(com.jcraft.jsch.ChannelSftp channel,
                                          String path)
        Deletes a remote file.
        Parameters:
        channel - the channel to use
        path - the file/dir to delete
        Returns:
        null if successful, otherwise error message
      • isDirRemote

        protected boolean isDirRemote​(String path)
        Checks whether the remote path is a directory.
        Specified by:
        isDirRemote in class AbstractRemoteFileOperations
        Parameters:
        path - the path to check
        Returns:
        true if path exists and is a directory