Package org.glassfish.cluster.ssh.sftp
Class SFTPClient
- java.lang.Object
-
- com.trilead.ssh2.SFTPv3Client
-
- org.glassfish.cluster.ssh.sftp.SFTPClient
-
public class SFTPClient extends com.trilead.ssh2.SFTPv3Client
-
-
Constructor Summary
Constructors Constructor Description SFTPClient(com.trilead.ssh2.Connection conn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.trilead.ssh2.SFTPv3FileAttributes_stat(String path)GracefulSFTPv3Client.stat(String)that returns null if the path doesn't exist.voidchmod(String path, int permissions)voidclose()Close the SFTP connection and free any resources associated with it.booleanexists(String path)Checks if the given path exists.voidmkdirs(String path, int posixPermission)Makes sure that the directory exists, by creating it if necessary.static StringnormalizePath(String path)InputStreamread(String file)OutputStreamwriteToFile(String path)Creates a new file and writes to it.-
Methods inherited from class com.trilead.ssh2.SFTPv3Client
canonicalPath, closeFile, createFile, createFile, createFileTruncate, createFileTruncate, createSymlink, fsetstat, fstat, getCharset, getProtocolVersion, ls, lstat, mkdir, mv, openFileRO, openFileRW, read, readLink, rm, rmdir, setCharset, setstat, stat, write
-
-
-
-
Constructor Detail
-
SFTPClient
public SFTPClient(com.trilead.ssh2.Connection conn) throws IOException- Throws:
IOException
-
-
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:
closein classcom.trilead.ssh2.SFTPv3Client
-
exists
public boolean exists(String path) throws IOException
Checks if the given path exists.- Overrides:
existsin classcom.trilead.ssh2.SFTPv3Client- Throws:
IOException
-
_stat
public com.trilead.ssh2.SFTPv3FileAttributes _stat(String path) throws IOException
GracefulSFTPv3Client.stat(String)that returns null if the path doesn't exist.- Overrides:
_statin classcom.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:
mkdirsin classcom.trilead.ssh2.SFTPv3Client- Throws:
IOException
-
writeToFile
public OutputStream writeToFile(String path) throws IOException
Creates a new file and writes to it.- Overrides:
writeToFilein classcom.trilead.ssh2.SFTPv3Client- Throws:
IOException
-
read
public InputStream read(String file) throws IOException
- Overrides:
readin classcom.trilead.ssh2.SFTPv3Client- Throws:
IOException
-
chmod
public void chmod(String path, int permissions) throws IOException
- Overrides:
chmodin classcom.trilead.ssh2.SFTPv3Client- Throws:
IOException
-
-