Class SFTPClient


  • public class SFTPClient
    extends com.trilead.ssh2.SFTPv3Client
    • Constructor Detail

    • Method Detail

      • close

        public void close()
        Close the SFTP connection and free any resources associated with it. close() should be called when you are done using the SFTPClient
        Overrides:
        close in class com.trilead.ssh2.SFTPv3Client
      • exists

        public boolean exists​(String path)
                       throws IOException
        Checks if the given path exists.
        Overrides:
        exists in class com.trilead.ssh2.SFTPv3Client
        Throws:
        IOException
      • _stat

        public com.trilead.ssh2.SFTPv3FileAttributes _stat​(String path)
                                                    throws IOException
        Graceful SFTPv3Client.stat(String) that returns null if the path doesn't exist.
        Overrides:
        _stat in class com.trilead.ssh2.SFTPv3Client
        Throws:
        IOException
      • mkdirs

        public void mkdirs​(String path,
                           int posixPermission)
                    throws IOException
        Makes sure that the directory exists, by creating it if necessary.
        Overrides:
        mkdirs in class com.trilead.ssh2.SFTPv3Client
        Throws:
        IOException
      • writeToFile

        public OutputStream writeToFile​(String path)
                                 throws IOException
        Creates a new file and writes to it.
        Overrides:
        writeToFile in class com.trilead.ssh2.SFTPv3Client
        Throws:
        IOException
      • chmod

        public void chmod​(String path,
                          int permissions)
                   throws IOException
        Overrides:
        chmod in class com.trilead.ssh2.SFTPv3Client
        Throws:
        IOException
      • normalizePath

        public static String normalizePath​(String path)