public class DefaultSftpClient extends Object implements SftpClient
SftpClient.Attribute, SftpClient.Attributes, SftpClient.DirEntry, SftpClient.Handle, SftpClient.OpenMode
Constructor and Description |
---|
DefaultSftpClient(ClientSession clientSession) |
Modifier and Type | Method and Description |
---|---|
String |
canonicalPath(String path) |
protected SftpClient.Attributes |
checkAttributes(Buffer buffer) |
protected int |
checkData(Buffer buffer,
int dstoff,
byte[] dst) |
protected SftpClient.DirEntry[] |
checkDir(Buffer buffer) |
protected SftpClient.Handle |
checkHandle(Buffer buffer) |
protected String |
checkOneName(Buffer buffer) |
protected void |
checkStatus(Buffer buffer) |
void |
close()
Close the client.
|
void |
close(SftpClient.Handle handle) |
protected int |
data(byte[] buf,
int start,
int len)
Receive binary data
|
protected void |
init() |
SftpClient.Attributes |
lstat(String path) |
void |
mkdir(String path) |
SftpClient.Handle |
open(String path,
EnumSet<SftpClient.OpenMode> options) |
SftpClient.Handle |
openDir(String path) |
protected void |
process(Buffer incoming)
Process an SFTP packet
|
protected Buffer |
read() |
int |
read(SftpClient.Handle handle,
long fileOffset,
byte[] dst,
int dstoff,
int len) |
InputStream |
read(String path) |
protected SftpClient.Attributes |
readAttributes(Buffer buffer) |
SftpClient.DirEntry[] |
readDir(SftpClient.Handle handle) |
Iterable<SftpClient.DirEntry> |
readDir(String path) |
String |
readLink(String path) |
protected boolean |
receive(Buffer incoming)
Read SFTP packets from buffer
|
protected Buffer |
receive(int id) |
void |
remove(String path) |
void |
rename(String oldPath,
String newPath) |
void |
rmdir(String path) |
protected int |
send(int cmd,
Buffer buffer) |
void |
setStat(SftpClient.Handle handle,
SftpClient.Attributes attributes) |
void |
setStat(String path,
SftpClient.Attributes attributes) |
SftpClient.Attributes |
stat(SftpClient.Handle handle) |
SftpClient.Attributes |
stat(String path) |
void |
symLink(String linkPath,
String targetPath) |
void |
write(SftpClient.Handle handle,
long fileOffset,
byte[] src,
int srcoff,
int len) |
OutputStream |
write(String path) |
protected void |
writeAttributes(Buffer buffer,
SftpClient.Attributes attributes) |
public static final int SSH_FXP_INIT
public static final int SSH_FXP_VERSION
public static final int SSH_FXP_OPEN
public static final int SSH_FXP_CLOSE
public static final int SSH_FXP_READ
public static final int SSH_FXP_WRITE
public static final int SSH_FXP_LSTAT
public static final int SSH_FXP_FSTAT
public static final int SSH_FXP_SETSTAT
public static final int SSH_FXP_FSETSTAT
public static final int SSH_FXP_OPENDIR
public static final int SSH_FXP_READDIR
public static final int SSH_FXP_REMOVE
public static final int SSH_FXP_MKDIR
public static final int SSH_FXP_RMDIR
public static final int SSH_FXP_REALPATH
public static final int SSH_FXP_STAT
public static final int SSH_FXP_RENAME
public static final int SSH_FXP_READLINK
public static final int SSH_FXP_SYMLINK
public static final int SSH_FXP_STATUS
public static final int SSH_FXP_HANDLE
public static final int SSH_FXP_DATA
public static final int SSH_FXP_NAME
public static final int SSH_FXP_ATTRS
public static final int SSH_FXP_EXTENDED
public static final int SSH_FXP_EXTENDED_REPLY
public static final int SSH_FX_OK
public static final int SSH_FX_EOF
public static final int SSH_FX_NO_SUCH_FILE
public static final int SSH_FX_PERMISSION_DENIED
public static final int SSH_FX_FAILURE
public static final int SSH_FX_BAD_MESSAGE
public static final int SSH_FX_NO_CONNECTION
public static final int SSH_FX_CONNECTION_LOST
public static final int SSH_FX_OP_UNSUPPORTED
public static final int SSH_FILEXFER_ATTR_SIZE
public static final int SSH_FILEXFER_ATTR_UIDGID
public static final int SSH_FILEXFER_ATTR_PERMISSIONS
public static final int SSH_FILEXFER_ATTR_ACMODTIME
public static final int SSH_FILEXFER_ATTR_EXTENDED
public static final int SSH_FXF_READ
public static final int SSH_FXF_WRITE
public static final int SSH_FXF_APPEND
public static final int SSH_FXF_CREAT
public static final int SSH_FXF_TRUNC
public static final int SSH_FXF_EXCL
public DefaultSftpClient(ClientSession clientSession) throws IOException
IOException
public void close() throws IOException
SftpClient
close
in interface SftpClient
IOException
protected int data(byte[] buf, int start, int len) throws IOException
IOException
protected boolean receive(Buffer incoming) throws IOException
IOException
protected void process(Buffer incoming) throws IOException
IOException
protected int send(int cmd, Buffer buffer) throws IOException
IOException
protected Buffer receive(int id) throws IOException
IOException
protected Buffer read() throws IOException
IOException
protected void init() throws IOException
IOException
protected void checkStatus(Buffer buffer) throws IOException
IOException
protected SftpClient.Handle checkHandle(Buffer buffer) throws IOException
IOException
protected SftpClient.Attributes checkAttributes(Buffer buffer) throws IOException
IOException
protected String checkOneName(Buffer buffer) throws IOException
IOException
protected SftpClient.Attributes readAttributes(Buffer buffer) throws IOException
IOException
protected void writeAttributes(Buffer buffer, SftpClient.Attributes attributes) throws IOException
IOException
public SftpClient.Handle open(String path, EnumSet<SftpClient.OpenMode> options) throws IOException
open
in interface SftpClient
IOException
public void close(SftpClient.Handle handle) throws IOException
close
in interface SftpClient
IOException
public void remove(String path) throws IOException
remove
in interface SftpClient
IOException
public void rename(String oldPath, String newPath) throws IOException
rename
in interface SftpClient
IOException
public int read(SftpClient.Handle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException
read
in interface SftpClient
IOException
protected int checkData(Buffer buffer, int dstoff, byte[] dst) throws SshException
SshException
public void write(SftpClient.Handle handle, long fileOffset, byte[] src, int srcoff, int len) throws IOException
write
in interface SftpClient
IOException
public void mkdir(String path) throws IOException
mkdir
in interface SftpClient
IOException
public void rmdir(String path) throws IOException
rmdir
in interface SftpClient
IOException
public SftpClient.Handle openDir(String path) throws IOException
openDir
in interface SftpClient
IOException
public SftpClient.DirEntry[] readDir(SftpClient.Handle handle) throws IOException
readDir
in interface SftpClient
IOException
protected SftpClient.DirEntry[] checkDir(Buffer buffer) throws IOException
IOException
public String canonicalPath(String path) throws IOException
canonicalPath
in interface SftpClient
IOException
public SftpClient.Attributes stat(String path) throws IOException
stat
in interface SftpClient
IOException
public SftpClient.Attributes lstat(String path) throws IOException
lstat
in interface SftpClient
IOException
public SftpClient.Attributes stat(SftpClient.Handle handle) throws IOException
stat
in interface SftpClient
IOException
public void setStat(String path, SftpClient.Attributes attributes) throws IOException
setStat
in interface SftpClient
IOException
public void setStat(SftpClient.Handle handle, SftpClient.Attributes attributes) throws IOException
setStat
in interface SftpClient
IOException
public String readLink(String path) throws IOException
readLink
in interface SftpClient
IOException
public void symLink(String linkPath, String targetPath) throws IOException
symLink
in interface SftpClient
IOException
public Iterable<SftpClient.DirEntry> readDir(String path) throws IOException
readDir
in interface SftpClient
IOException
public InputStream read(String path) throws IOException
read
in interface SftpClient
IOException
public OutputStream write(String path) throws IOException
write
in interface SftpClient
IOException
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.