public class SFTPClient extends SFTPv3Client
Constructor and Description |
---|
SFTPClient(Connection conn) |
Modifier and Type | Method and Description |
---|---|
SFTPv3FileAttributes |
_stat(String path)
Graceful
SFTPv3Client.stat(String) that returns null if the path doesn't exist. |
void |
chmod(String path,
int permissions)
Change file or directory permissions.
|
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.
|
InputStream |
read(String file)
Read input stream.
|
OutputStream |
writeToFile(String path)
Creates a new file and writes to it.
|
canonicalPath, close, closeFile, createFile, createFile, createFileTruncate, createFileTruncate, createSymlink, fsetstat, fstat, getCharset, getProtocolVersion, ls, lstat, mkdir, mv, openFileRO, openFileRW, read, readLink, rm, rmdir, setCharset, setstat, stat, write
public SFTPClient(Connection conn) throws IOException
IOException
public boolean exists(String path) throws IOException
exists
in class SFTPv3Client
path
- directory or file path.IOException
- if it is not possible to access to the directory or file .public SFTPv3FileAttributes _stat(String path) throws IOException
SFTPv3Client.stat(String)
that returns null if the path doesn't exist._stat
in class SFTPv3Client
path
- directory path.IOException
- if it is not possible to access to the directory.public void mkdirs(String path, int posixPermission) throws IOException
mkdirs
in class SFTPv3Client
path
- directory path.posixPermission
- POSIX permissions.IOException
- if it is not possible to access to the directory.public OutputStream writeToFile(String path) throws IOException
SFTPv3Client
writeToFile
in class SFTPv3Client
path
- file path.IOException
- if it is not possible to access to the file.public InputStream read(String file) throws IOException
SFTPv3Client
read
in class SFTPv3Client
file
- file path.IOException
- if it is not possible to access to the file.public void chmod(String path, int permissions) throws IOException
chmod
in class SFTPv3Client
path
- file or directory path.permissions
- POSIX permissions.IOException
- in case of error.Copyright © 2020. All rights reserved.