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.void
chmod(String path, int permissions)
void
close()
Close the SFTP connection and free any resources associated with it.boolean
exists(String path)
Checks if the given path exists.void
mkdirs(String path, int posixPermission)
Makes sure that the directory exists, by creating it if necessary.static String
normalizePath(String path)
InputStream
read(String file)
OutputStream
writeToFile(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:
close
in classcom.trilead.ssh2.SFTPv3Client
-
exists
public boolean exists(String path) throws IOException
Checks if the given path exists.- Overrides:
exists
in 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:
_stat
in 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:
mkdirs
in classcom.trilead.ssh2.SFTPv3Client
- Throws:
IOException
-
writeToFile
public OutputStream writeToFile(String path) throws IOException
Creates a new file and writes to it.- Overrides:
writeToFile
in classcom.trilead.ssh2.SFTPv3Client
- Throws:
IOException
-
read
public InputStream read(String file) throws IOException
- Overrides:
read
in classcom.trilead.ssh2.SFTPv3Client
- Throws:
IOException
-
chmod
public void chmod(String path, int permissions) throws IOException
- Overrides:
chmod
in classcom.trilead.ssh2.SFTPv3Client
- Throws:
IOException
-
-