public class DefaultSftpClient extends java.lang.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 |
|---|---|
java.lang.String |
canonicalPath(java.lang.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 java.lang.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(java.lang.String path) |
void |
mkdir(java.lang.String path) |
SftpClient.Handle |
open(java.lang.String path,
java.util.EnumSet<SftpClient.OpenMode> options) |
SftpClient.Handle |
openDir(java.lang.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) |
java.io.InputStream |
read(java.lang.String path) |
protected SftpClient.Attributes |
readAttributes(Buffer buffer) |
SftpClient.DirEntry[] |
readDir(SftpClient.Handle handle) |
java.lang.Iterable<SftpClient.DirEntry> |
readDir(java.lang.String path) |
java.lang.String |
readLink(java.lang.String path) |
protected boolean |
receive(Buffer incoming)
Read SFTP packets from buffer
|
protected Buffer |
receive(int id) |
void |
remove(java.lang.String path) |
void |
rename(java.lang.String oldPath,
java.lang.String newPath) |
void |
rmdir(java.lang.String path) |
protected int |
send(int cmd,
Buffer buffer) |
void |
setStat(SftpClient.Handle handle,
SftpClient.Attributes attributes) |
void |
setStat(java.lang.String path,
SftpClient.Attributes attributes) |
SftpClient.Attributes |
stat(SftpClient.Handle handle) |
SftpClient.Attributes |
stat(java.lang.String path) |
void |
symLink(java.lang.String linkPath,
java.lang.String targetPath) |
void |
write(SftpClient.Handle handle,
long fileOffset,
byte[] src,
int srcoff,
int len) |
java.io.OutputStream |
write(java.lang.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 java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
SftpClientclose in interface SftpClientjava.io.IOExceptionprotected int data(byte[] buf,
int start,
int len)
throws java.io.IOException
java.io.IOExceptionprotected boolean receive(Buffer incoming) throws java.io.IOException
java.io.IOExceptionprotected void process(Buffer incoming) throws java.io.IOException
java.io.IOExceptionprotected int send(int cmd,
Buffer buffer)
throws java.io.IOException
java.io.IOExceptionprotected Buffer receive(int id) throws java.io.IOException
java.io.IOExceptionprotected Buffer read() throws java.io.IOException
java.io.IOExceptionprotected void init()
throws java.io.IOException
java.io.IOExceptionprotected void checkStatus(Buffer buffer) throws java.io.IOException
java.io.IOExceptionprotected SftpClient.Handle checkHandle(Buffer buffer) throws java.io.IOException
java.io.IOExceptionprotected SftpClient.Attributes checkAttributes(Buffer buffer) throws java.io.IOException
java.io.IOExceptionprotected java.lang.String checkOneName(Buffer buffer) throws java.io.IOException
java.io.IOExceptionprotected SftpClient.Attributes readAttributes(Buffer buffer) throws java.io.IOException
java.io.IOExceptionprotected void writeAttributes(Buffer buffer, SftpClient.Attributes attributes) throws java.io.IOException
java.io.IOExceptionpublic SftpClient.Handle open(java.lang.String path, java.util.EnumSet<SftpClient.OpenMode> options) throws java.io.IOException
open in interface SftpClientjava.io.IOExceptionpublic void close(SftpClient.Handle handle) throws java.io.IOException
close in interface SftpClientjava.io.IOExceptionpublic void remove(java.lang.String path)
throws java.io.IOException
remove in interface SftpClientjava.io.IOExceptionpublic void rename(java.lang.String oldPath,
java.lang.String newPath)
throws java.io.IOException
rename in interface SftpClientjava.io.IOExceptionpublic int read(SftpClient.Handle handle, long fileOffset, byte[] dst, int dstoff, int len) throws java.io.IOException
read in interface SftpClientjava.io.IOExceptionprotected int checkData(Buffer buffer, int dstoff, byte[] dst) throws SshException
SshExceptionpublic void write(SftpClient.Handle handle, long fileOffset, byte[] src, int srcoff, int len) throws java.io.IOException
write in interface SftpClientjava.io.IOExceptionpublic void mkdir(java.lang.String path)
throws java.io.IOException
mkdir in interface SftpClientjava.io.IOExceptionpublic void rmdir(java.lang.String path)
throws java.io.IOException
rmdir in interface SftpClientjava.io.IOExceptionpublic SftpClient.Handle openDir(java.lang.String path) throws java.io.IOException
openDir in interface SftpClientjava.io.IOExceptionpublic SftpClient.DirEntry[] readDir(SftpClient.Handle handle) throws java.io.IOException
readDir in interface SftpClientjava.io.IOExceptionprotected SftpClient.DirEntry[] checkDir(Buffer buffer) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String canonicalPath(java.lang.String path)
throws java.io.IOException
canonicalPath in interface SftpClientjava.io.IOExceptionpublic SftpClient.Attributes stat(java.lang.String path) throws java.io.IOException
stat in interface SftpClientjava.io.IOExceptionpublic SftpClient.Attributes lstat(java.lang.String path) throws java.io.IOException
lstat in interface SftpClientjava.io.IOExceptionpublic SftpClient.Attributes stat(SftpClient.Handle handle) throws java.io.IOException
stat in interface SftpClientjava.io.IOExceptionpublic void setStat(java.lang.String path,
SftpClient.Attributes attributes)
throws java.io.IOException
setStat in interface SftpClientjava.io.IOExceptionpublic void setStat(SftpClient.Handle handle, SftpClient.Attributes attributes) throws java.io.IOException
setStat in interface SftpClientjava.io.IOExceptionpublic java.lang.String readLink(java.lang.String path)
throws java.io.IOException
readLink in interface SftpClientjava.io.IOExceptionpublic void symLink(java.lang.String linkPath,
java.lang.String targetPath)
throws java.io.IOException
symLink in interface SftpClientjava.io.IOExceptionpublic java.lang.Iterable<SftpClient.DirEntry> readDir(java.lang.String path) throws java.io.IOException
readDir in interface SftpClientjava.io.IOExceptionpublic java.io.InputStream read(java.lang.String path)
throws java.io.IOException
read in interface SftpClientjava.io.IOExceptionpublic java.io.OutputStream write(java.lang.String path)
throws java.io.IOException
write in interface SftpClientjava.io.IOExceptionCopyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.