Class SFTPFileSystem

    • Constructor Detail

      • SFTPFileSystem

        public SFTPFileSystem​(InetAddress host,
                              int port,
                              String username,
                              String basePath,
                              boolean absoluteBasePath)
    • Method Detail

      • isReusable

        public boolean isReusable()
        Description copied from interface: AbstractFileSystem
        If disconnected, can we re-connect after ?
      • isAvaliable

        public boolean isAvaliable()
      • getIOBufferSize

        public int getIOBufferSize()
        Description copied from interface: AbstractFileSystem
        65535 bytes
      • setPasswordAuth

        public void setPasswordAuth​(char[] password)
      • manuallyAddPrivatekeyAuth

        public void manuallyAddPrivatekeyAuth​(File privateKey,
                                              char[] keyPassword)
        Parameters:
        privateKey - can be a file, or a directory of key files (like "~/.ssh/")
      • manuallyAddPrivatekeyAuth

        public void manuallyAddPrivatekeyAuth​(File privateKey)
        Parameters:
        privateKey - can be a file, or a directory of key files (like "~/.ssh/")
      • getClient

        public net.schmizz.sshj.SSHClient getClient()
      • getSFTPClient

        public net.schmizz.sshj.sftp.SFTPClient getSFTPClient()
      • connect

        public void connect()
      • isStatefulSFTPClient

        public boolean isStatefulSFTPClient()
      • setStatefulSFTPClient

        public void setStatefulSFTPClient​(boolean statefulSFTPClient)
      • createANewSFTPClient

        public void createANewSFTPClient()
        Needed for simultaneous transferts: a = getFromPath() + createANewSFTPClient() + b = getFromPath() > a and b can do actions in same time.
      • close

        public void close()
      • getFromPath

        public SFTPFile getFromPath​(String path)
        Parameters:
        path - relative path only
      • isAbsoluteBasePath

        public boolean isAbsoluteBasePath()
      • getUsername

        public String getUsername()
      • reusableHashCode

        public int reusableHashCode()
        Returns:
        the same code for the same internal engine instance in FileSystem. Can be used for interract two FS and protect the both are not the same.