Package com.jcraft.jsch
Class ChannelSftp
- java.lang.Object
-
- com.jcraft.jsch.Channel
-
- com.jcraft.jsch.ChannelSession
-
- com.jcraft.jsch.ChannelSftp
-
- All Implemented Interfaces:
java.lang.Runnable
public class ChannelSftp extends ChannelSession
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
ChannelSftp.Header
class
ChannelSftp.LsEntry
static interface
ChannelSftp.LsEntrySelector
This interface will be passed as an argument forls
method.private class
ChannelSftp.RequestQueue
-
Nested classes/interfaces inherited from class com.jcraft.jsch.Channel
Channel.MyPipedInputStream, Channel.PassiveInputStream, Channel.PassiveOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private int[]
ackid
static int
APPEND
private Buffer
buf
private int
client_version
private java.lang.String
cwd
private boolean
extension_hardlink
private boolean
extension_posix_rename
private boolean
extension_statvfs
private java.util.Hashtable
extensions
private java.lang.String
fEncoding
private boolean
fEncoding_is_utf8
private static java.lang.String
file_separator
private static char
file_separatorc
private static boolean
fs_is_bs
private java.lang.String
home
private boolean
interactive
private java.io.InputStream
io_in
private java.lang.String
lcwd
private static int
LOCAL_MAXIMUM_PACKET_SIZE
private static int
LOCAL_WINDOW_SIZE_MAX
private static int
MAX_MSG_LENGTH
private Buffer
obuf
private Packet
opacket
static int
OVERWRITE
private Packet
packet
static int
RESUME
private ChannelSftp.RequestQueue
rq
private int
seq
private int
server_version
private static int
SSH_FILEXFER_ATTR_ACMODTIME
private static int
SSH_FILEXFER_ATTR_EXTENDED
private static int
SSH_FILEXFER_ATTR_PERMISSIONS
private static int
SSH_FILEXFER_ATTR_SIZE
private static int
SSH_FILEXFER_ATTR_UIDGID
static int
SSH_FX_BAD_MESSAGE
static int
SSH_FX_CONNECTION_LOST
static int
SSH_FX_EOF
static int
SSH_FX_FAILURE
static int
SSH_FX_NO_CONNECTION
static int
SSH_FX_NO_SUCH_FILE
static int
SSH_FX_OK
static int
SSH_FX_OP_UNSUPPORTED
static int
SSH_FX_PERMISSION_DENIED
private static int
SSH_FXF_APPEND
private static int
SSH_FXF_CREAT
private static int
SSH_FXF_EXCL
private static int
SSH_FXF_READ
private static int
SSH_FXF_TRUNC
private static int
SSH_FXF_WRITE
private static byte
SSH_FXP_ATTRS
private static byte
SSH_FXP_CLOSE
private static byte
SSH_FXP_DATA
private static byte
SSH_FXP_EXTENDED
private static byte
SSH_FXP_EXTENDED_REPLY
private static byte
SSH_FXP_FSETSTAT
private static byte
SSH_FXP_FSTAT
private static byte
SSH_FXP_HANDLE
private static byte
SSH_FXP_INIT
private static byte
SSH_FXP_LSTAT
private static byte
SSH_FXP_MKDIR
private static byte
SSH_FXP_NAME
private static byte
SSH_FXP_OPEN
private static byte
SSH_FXP_OPENDIR
private static byte
SSH_FXP_READ
private static byte
SSH_FXP_READDIR
private static byte
SSH_FXP_READLINK
private static byte
SSH_FXP_REALPATH
private static byte
SSH_FXP_REMOVE
private static byte
SSH_FXP_RENAME
private static byte
SSH_FXP_RMDIR
private static byte
SSH_FXP_SETSTAT
private static byte
SSH_FXP_STAT
private static byte
SSH_FXP_STATUS
private static byte
SSH_FXP_SYMLINK
private static byte
SSH_FXP_VERSION
private static byte
SSH_FXP_WRITE
private static java.lang.String
UTF8
private java.lang.String
version
-
Fields inherited from class com.jcraft.jsch.ChannelSession
agent_forwarding, env, pty, tcol, terminal_mode, thp, trow, ttype, twp, xforwading
-
Fields inherited from class com.jcraft.jsch.Channel
close, connected, connectTimeout, eof_local, eof_remote, exitstatus, id, index, io, lmpsize, lwsize, lwsize_max, notifyme, open_confirmation, recipient, reply, rmpsize, rwsize, SSH_MSG_CHANNEL_OPEN_CONFIRMATION, SSH_MSG_CHANNEL_OPEN_FAILURE, SSH_MSG_CHANNEL_WINDOW_ADJUST, SSH_OPEN_ADMINISTRATIVELY_PROHIBITED, SSH_OPEN_CONNECT_FAILED, SSH_OPEN_RESOURCE_SHORTAGE, SSH_OPEN_UNKNOWN_CHANNEL_TYPE, thread, type
-
-
Constructor Summary
Constructors Constructor Description ChannelSftp()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
_get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor, int mode, long skip)
private SftpATTRS
_lstat(java.lang.String path)
void
_put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode)
private byte[]
_realpath(java.lang.String path)
private boolean
_sendCLOSE(byte[] handle, ChannelSftp.Header header)
private void
_setStat(java.lang.String path, SftpATTRS attr)
private SftpATTRS
_stat(byte[] path)
private SftpATTRS
_stat(java.lang.String path)
private SftpStatVFS
_statVFS(byte[] path)
private SftpStatVFS
_statVFS(java.lang.String path)
void
cd(java.lang.String path)
private boolean
checkStatus(int[] ackid, ChannelSftp.Header header)
void
chgrp(int gid, java.lang.String path)
void
chmod(int permissions, java.lang.String path)
void
chown(int uid, java.lang.String path)
void
disconnect()
void
exit()
private int
fill(byte[] buf, int s, int len)
private void
fill(Buffer buf, int len)
java.io.InputStream
get(java.lang.String src)
java.io.InputStream
get(java.lang.String src, int mode)
Deprecated.This method will be deleted in the future.java.io.InputStream
get(java.lang.String src, SftpProgressMonitor monitor)
java.io.InputStream
get(java.lang.String src, SftpProgressMonitor monitor, int mode)
Deprecated.This method will be deleted in the future.java.io.InputStream
get(java.lang.String src, SftpProgressMonitor monitor, long skip)
void
get(java.lang.String src, java.io.OutputStream dst)
void
get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor)
void
get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor, int mode, long skip)
void
get(java.lang.String src, java.lang.String dst)
void
get(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor)
void
get(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode)
int
getBulkRequests()
This method will return the value how many requests may be sent at any one time.private java.lang.String
getCwd()
java.lang.String
getExtension(java.lang.String key)
java.lang.String
getHome()
int
getServerVersion()
private java.util.Vector
glob_local(java.lang.String _path)
private java.util.Vector
glob_remote(java.lang.String _path)
void
hardlink(java.lang.String oldpath, java.lang.String newpath)
private ChannelSftp.Header
header(Buffer buf, ChannelSftp.Header header)
(package private) void
init()
private static boolean
isLocalAbsolutePath(java.lang.String path)
private boolean
isPattern(byte[] path)
private boolean
isPattern(java.lang.String path)
private boolean
isPattern(java.lang.String path, byte[][] utf8)
private boolean
isRemoteDir(java.lang.String path)
private java.lang.String
isUnique(java.lang.String path)
This method will check if the given string can be expanded to the unique string.void
lcd(java.lang.String path)
private java.lang.String
localAbsolutePath(java.lang.String path)
java.lang.String
lpwd()
java.util.Vector
ls(java.lang.String path)
void
ls(java.lang.String path, ChannelSftp.LsEntrySelector selector)
List files specified by the remotepath
.SftpATTRS
lstat(java.lang.String path)
void
mkdir(java.lang.String path)
void
put(java.io.InputStream src, java.lang.String dst)
void
put(java.io.InputStream src, java.lang.String dst, int mode)
void
put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor)
void
put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode)
Sends data from the input streamsrc
todst
file.java.io.OutputStream
put(java.lang.String dst)
java.io.OutputStream
put(java.lang.String dst, int mode)
java.io.OutputStream
put(java.lang.String dst, SftpProgressMonitor monitor, int mode)
java.io.OutputStream
put(java.lang.String dst, SftpProgressMonitor monitor, int mode, long offset)
Sends data from the output stream todst
file.void
put(java.lang.String src, java.lang.String dst)
void
put(java.lang.String src, java.lang.String dst, int mode)
void
put(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor)
void
put(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode)
Sends data fromsrc
file todst
file.private void
putHEAD(byte type, int length)
private void
putHEAD(Buffer buf, byte type, int length)
java.lang.String
pwd()
void
quit()
private void
read(byte[] buf, int s, int l)
java.lang.String
readlink(java.lang.String path)
java.lang.String
realpath(java.lang.String path)
private java.lang.String
remoteAbsolutePath(java.lang.String path)
void
rename(java.lang.String oldpath, java.lang.String newpath)
void
rm(java.lang.String path)
void
rmdir(java.lang.String path)
private void
sendCLOSE(byte[] path)
private void
sendFSTAT(byte[] handle)
private void
sendHARDLINK(byte[] p1, byte[] p2)
private void
sendINIT()
private void
sendLSTAT(byte[] path)
private void
sendMKDIR(byte[] path, SftpATTRS attr)
private void
sendOPEN(byte[] path, int mode)
private void
sendOPENA(byte[] path)
private void
sendOPENDIR(byte[] path)
private void
sendOPENR(byte[] path)
private void
sendOPENW(byte[] path)
private void
sendPacketPath(byte fxp, byte[] path)
private void
sendPacketPath(byte fxp, byte[] p1, byte[] p2)
private void
sendPacketPath(byte fxp, byte[] p1, byte[] p2, java.lang.String extension)
private void
sendPacketPath(byte fxp, byte[] path, java.lang.String extension)
private void
sendREAD(byte[] handle, long offset, int length)
private void
sendREAD(byte[] handle, long offset, int length, ChannelSftp.RequestQueue rrq)
private void
sendREADDIR(byte[] path)
private void
sendREADLINK(byte[] path)
private void
sendREALPATH(byte[] path)
private void
sendREMOVE(byte[] path)
private void
sendRENAME(byte[] p1, byte[] p2)
private void
sendRMDIR(byte[] path)
private void
sendSETSTAT(byte[] path, SftpATTRS attr)
private void
sendSTAT(byte[] path)
private void
sendSTATVFS(byte[] path)
private void
sendSYMLINK(byte[] p1, byte[] p2)
private int
sendWRITE(byte[] handle, long offset, byte[] data, int start, int length)
void
setBulkRequests(int bulk_requests)
Specify how many requests may be sent at any one time.private void
setCwd(java.lang.String cwd)
void
setFilenameEncoding(java.lang.String encoding)
void
setMtime(java.lang.String path, int mtime)
void
setStat(java.lang.String path, SftpATTRS attr)
private void
skip(long foo)
void
start()
SftpATTRS
stat(java.lang.String path)
SftpStatVFS
statVFS(java.lang.String path)
void
symlink(java.lang.String oldpath, java.lang.String newpath)
private void
throwStatusError(Buffer buf, int i)
java.lang.String
version()
-
Methods inherited from class com.jcraft.jsch.ChannelSession
run, sendRequests, setAgentForwarding, setEnv, setEnv, setEnv, setPty, setPtySize, setPtyType, setPtyType, setTerminalMode, setXForwarding
-
Methods inherited from class com.jcraft.jsch.Channel
addRemoteWindowSize, close, connect, connect, del, disconnect, eof, eof_remote, genChannelOpenPacket, getChannel, getChannel, getData, getExitStatus, getExtInputStream, getId, getInputStream, getOutputStream, getRecipient, getSession, isClosed, isConnected, isEOF, sendChannelOpen, sendOpenConfirmation, sendOpenFailure, sendSignal, setExitStatus, setExtOutputStream, setExtOutputStream, setInputStream, setInputStream, setLocalPacketSize, setLocalWindowSize, setLocalWindowSizeMax, setOutputStream, setOutputStream, setRecipient, setRemotePacketSize, setRemoteWindowSize, setSession, write, write, write_ext
-
-
-
-
Field Detail
-
LOCAL_MAXIMUM_PACKET_SIZE
private static final int LOCAL_MAXIMUM_PACKET_SIZE
- See Also:
- Constant Field Values
-
LOCAL_WINDOW_SIZE_MAX
private static final int LOCAL_WINDOW_SIZE_MAX
- See Also:
- Constant Field Values
-
SSH_FXP_INIT
private static final byte SSH_FXP_INIT
- See Also:
- Constant Field Values
-
SSH_FXP_VERSION
private static final byte SSH_FXP_VERSION
- See Also:
- Constant Field Values
-
SSH_FXP_OPEN
private static final byte SSH_FXP_OPEN
- See Also:
- Constant Field Values
-
SSH_FXP_CLOSE
private static final byte SSH_FXP_CLOSE
- See Also:
- Constant Field Values
-
SSH_FXP_READ
private static final byte SSH_FXP_READ
- See Also:
- Constant Field Values
-
SSH_FXP_WRITE
private static final byte SSH_FXP_WRITE
- See Also:
- Constant Field Values
-
SSH_FXP_LSTAT
private static final byte SSH_FXP_LSTAT
- See Also:
- Constant Field Values
-
SSH_FXP_FSTAT
private static final byte SSH_FXP_FSTAT
- See Also:
- Constant Field Values
-
SSH_FXP_SETSTAT
private static final byte SSH_FXP_SETSTAT
- See Also:
- Constant Field Values
-
SSH_FXP_FSETSTAT
private static final byte SSH_FXP_FSETSTAT
- See Also:
- Constant Field Values
-
SSH_FXP_OPENDIR
private static final byte SSH_FXP_OPENDIR
- See Also:
- Constant Field Values
-
SSH_FXP_READDIR
private static final byte SSH_FXP_READDIR
- See Also:
- Constant Field Values
-
SSH_FXP_REMOVE
private static final byte SSH_FXP_REMOVE
- See Also:
- Constant Field Values
-
SSH_FXP_MKDIR
private static final byte SSH_FXP_MKDIR
- See Also:
- Constant Field Values
-
SSH_FXP_RMDIR
private static final byte SSH_FXP_RMDIR
- See Also:
- Constant Field Values
-
SSH_FXP_REALPATH
private static final byte SSH_FXP_REALPATH
- See Also:
- Constant Field Values
-
SSH_FXP_STAT
private static final byte SSH_FXP_STAT
- See Also:
- Constant Field Values
-
SSH_FXP_RENAME
private static final byte SSH_FXP_RENAME
- See Also:
- Constant Field Values
-
SSH_FXP_READLINK
private static final byte SSH_FXP_READLINK
- See Also:
- Constant Field Values
-
SSH_FXP_SYMLINK
private static final byte SSH_FXP_SYMLINK
- See Also:
- Constant Field Values
-
SSH_FXP_STATUS
private static final byte SSH_FXP_STATUS
- See Also:
- Constant Field Values
-
SSH_FXP_HANDLE
private static final byte SSH_FXP_HANDLE
- See Also:
- Constant Field Values
-
SSH_FXP_DATA
private static final byte SSH_FXP_DATA
- See Also:
- Constant Field Values
-
SSH_FXP_NAME
private static final byte SSH_FXP_NAME
- See Also:
- Constant Field Values
-
SSH_FXP_ATTRS
private static final byte SSH_FXP_ATTRS
- See Also:
- Constant Field Values
-
SSH_FXP_EXTENDED
private static final byte SSH_FXP_EXTENDED
- See Also:
- Constant Field Values
-
SSH_FXP_EXTENDED_REPLY
private static final byte SSH_FXP_EXTENDED_REPLY
- See Also:
- Constant Field Values
-
SSH_FXF_READ
private static final int SSH_FXF_READ
- See Also:
- Constant Field Values
-
SSH_FXF_WRITE
private static final int SSH_FXF_WRITE
- See Also:
- Constant Field Values
-
SSH_FXF_APPEND
private static final int SSH_FXF_APPEND
- See Also:
- Constant Field Values
-
SSH_FXF_CREAT
private static final int SSH_FXF_CREAT
- See Also:
- Constant Field Values
-
SSH_FXF_TRUNC
private static final int SSH_FXF_TRUNC
- See Also:
- Constant Field Values
-
SSH_FXF_EXCL
private static final int SSH_FXF_EXCL
- See Also:
- Constant Field Values
-
SSH_FILEXFER_ATTR_SIZE
private static final int SSH_FILEXFER_ATTR_SIZE
- See Also:
- Constant Field Values
-
SSH_FILEXFER_ATTR_UIDGID
private static final int SSH_FILEXFER_ATTR_UIDGID
- See Also:
- Constant Field Values
-
SSH_FILEXFER_ATTR_PERMISSIONS
private static final int SSH_FILEXFER_ATTR_PERMISSIONS
- See Also:
- Constant Field Values
-
SSH_FILEXFER_ATTR_ACMODTIME
private static final int SSH_FILEXFER_ATTR_ACMODTIME
- See Also:
- Constant Field Values
-
SSH_FILEXFER_ATTR_EXTENDED
private static final int SSH_FILEXFER_ATTR_EXTENDED
- See Also:
- Constant Field Values
-
SSH_FX_OK
public static final int SSH_FX_OK
- See Also:
- Constant Field Values
-
SSH_FX_EOF
public static final int SSH_FX_EOF
- See Also:
- Constant Field Values
-
SSH_FX_NO_SUCH_FILE
public static final int SSH_FX_NO_SUCH_FILE
- See Also:
- Constant Field Values
-
SSH_FX_PERMISSION_DENIED
public static final int SSH_FX_PERMISSION_DENIED
- See Also:
- Constant Field Values
-
SSH_FX_FAILURE
public static final int SSH_FX_FAILURE
- See Also:
- Constant Field Values
-
SSH_FX_BAD_MESSAGE
public static final int SSH_FX_BAD_MESSAGE
- See Also:
- Constant Field Values
-
SSH_FX_NO_CONNECTION
public static final int SSH_FX_NO_CONNECTION
- See Also:
- Constant Field Values
-
SSH_FX_CONNECTION_LOST
public static final int SSH_FX_CONNECTION_LOST
- See Also:
- Constant Field Values
-
SSH_FX_OP_UNSUPPORTED
public static final int SSH_FX_OP_UNSUPPORTED
- See Also:
- Constant Field Values
-
MAX_MSG_LENGTH
private static final int MAX_MSG_LENGTH
- See Also:
- Constant Field Values
-
OVERWRITE
public static final int OVERWRITE
- See Also:
- Constant Field Values
-
RESUME
public static final int RESUME
- See Also:
- Constant Field Values
-
APPEND
public static final int APPEND
- See Also:
- Constant Field Values
-
interactive
private boolean interactive
-
seq
private int seq
-
ackid
private int[] ackid
-
buf
private Buffer buf
-
packet
private Packet packet
-
obuf
private Buffer obuf
-
opacket
private Packet opacket
-
client_version
private int client_version
-
server_version
private int server_version
-
version
private java.lang.String version
-
extensions
private java.util.Hashtable extensions
-
io_in
private java.io.InputStream io_in
-
extension_posix_rename
private boolean extension_posix_rename
-
extension_statvfs
private boolean extension_statvfs
-
extension_hardlink
private boolean extension_hardlink
-
file_separator
private static final java.lang.String file_separator
-
file_separatorc
private static final char file_separatorc
-
fs_is_bs
private static boolean fs_is_bs
-
cwd
private java.lang.String cwd
-
home
private java.lang.String home
-
lcwd
private java.lang.String lcwd
-
UTF8
private static final java.lang.String UTF8
- See Also:
- Constant Field Values
-
fEncoding
private java.lang.String fEncoding
-
fEncoding_is_utf8
private boolean fEncoding_is_utf8
-
rq
private ChannelSftp.RequestQueue rq
-
-
Method Detail
-
setBulkRequests
public void setBulkRequests(int bulk_requests) throws JSchException
Specify how many requests may be sent at any one time. Increasing this value may slightly improve file transfer speed but will increase memory usage. The default is 16 requests.- Parameters:
bulk_requests
- how many requests may be outstanding at any one time.- Throws:
JSchException
-
getBulkRequests
public int getBulkRequests()
This method will return the value how many requests may be sent at any one time.- Returns:
- how many requests may be sent at any one time.
-
start
public void start() throws JSchException
- Overrides:
start
in classChannel
- Throws:
JSchException
-
quit
public void quit()
-
exit
public void exit()
-
lcd
public void lcd(java.lang.String path) throws SftpException
- Throws:
SftpException
-
cd
public void cd(java.lang.String path) throws SftpException
- Throws:
SftpException
-
put
public void put(java.lang.String src, java.lang.String dst) throws SftpException
- Throws:
SftpException
-
put
public void put(java.lang.String src, java.lang.String dst, int mode) throws SftpException
- Throws:
SftpException
-
put
public void put(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor) throws SftpException
- Throws:
SftpException
-
put
public void put(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
Sends data fromsrc
file todst
file. Themode
should beOVERWRITE
,RESUME
orAPPEND
.- Parameters:
src
- source filedst
- destination filemonitor
- progress monitormode
- how data should be added to dst- Throws:
SftpException
-
put
public void put(java.io.InputStream src, java.lang.String dst) throws SftpException
- Throws:
SftpException
-
put
public void put(java.io.InputStream src, java.lang.String dst, int mode) throws SftpException
- Throws:
SftpException
-
put
public void put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor) throws SftpException
- Throws:
SftpException
-
put
public void put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
Sends data from the input streamsrc
todst
file. Themode
should beOVERWRITE
,RESUME
orAPPEND
.- Parameters:
src
- input streamdst
- destination filemonitor
- progress monitormode
- how data should be added to dst- Throws:
SftpException
-
_put
public void _put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
- Throws:
SftpException
-
put
public java.io.OutputStream put(java.lang.String dst) throws SftpException
- Throws:
SftpException
-
put
public java.io.OutputStream put(java.lang.String dst, int mode) throws SftpException
- Throws:
SftpException
-
put
public java.io.OutputStream put(java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
- Throws:
SftpException
-
put
public java.io.OutputStream put(java.lang.String dst, SftpProgressMonitor monitor, int mode, long offset) throws SftpException
Sends data from the output stream todst
file. Themode
should beOVERWRITE
,RESUME
orAPPEND
.- Parameters:
dst
- destination filemonitor
- progress monitormode
- how data should be added to dstoffset
- data will be added at offset- Returns:
- output stream, which accepts data to be transferred.
- Throws:
SftpException
-
get
public void get(java.lang.String src, java.lang.String dst) throws SftpException
- Throws:
SftpException
-
get
public void get(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor) throws SftpException
- Throws:
SftpException
-
get
public void get(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
- Throws:
SftpException
-
get
public void get(java.lang.String src, java.io.OutputStream dst) throws SftpException
- Throws:
SftpException
-
get
public void get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor) throws SftpException
- Throws:
SftpException
-
get
public void get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor, int mode, long skip) throws SftpException
- Throws:
SftpException
-
_get
private void _get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor, int mode, long skip) throws SftpException
- Throws:
SftpException
-
get
public java.io.InputStream get(java.lang.String src) throws SftpException
- Throws:
SftpException
-
get
public java.io.InputStream get(java.lang.String src, SftpProgressMonitor monitor) throws SftpException
- Throws:
SftpException
-
get
public java.io.InputStream get(java.lang.String src, int mode) throws SftpException
Deprecated.This method will be deleted in the future.- Throws:
SftpException
-
get
public java.io.InputStream get(java.lang.String src, SftpProgressMonitor monitor, int mode) throws SftpException
Deprecated.This method will be deleted in the future.- Throws:
SftpException
-
get
public java.io.InputStream get(java.lang.String src, SftpProgressMonitor monitor, long skip) throws SftpException
- Throws:
SftpException
-
ls
public java.util.Vector ls(java.lang.String path) throws SftpException
- Throws:
SftpException
-
ls
public void ls(java.lang.String path, ChannelSftp.LsEntrySelector selector) throws SftpException
List files specified by the remotepath
. Each files and directories will be passed toLsEntrySelector#select(LsEntry)
method, and if that method returnsLsEntrySelector#BREAK
, the operation will be canceled immediately.- Throws:
SftpException
- Since:
- 0.1.47
- See Also:
ChannelSftp.LsEntrySelector
-
readlink
public java.lang.String readlink(java.lang.String path) throws SftpException
- Throws:
SftpException
-
symlink
public void symlink(java.lang.String oldpath, java.lang.String newpath) throws SftpException
- Throws:
SftpException
-
hardlink
public void hardlink(java.lang.String oldpath, java.lang.String newpath) throws SftpException
- Throws:
SftpException
-
rename
public void rename(java.lang.String oldpath, java.lang.String newpath) throws SftpException
- Throws:
SftpException
-
rm
public void rm(java.lang.String path) throws SftpException
- Throws:
SftpException
-
isRemoteDir
private boolean isRemoteDir(java.lang.String path)
-
chgrp
public void chgrp(int gid, java.lang.String path) throws SftpException
- Throws:
SftpException
-
chown
public void chown(int uid, java.lang.String path) throws SftpException
- Throws:
SftpException
-
chmod
public void chmod(int permissions, java.lang.String path) throws SftpException
- Throws:
SftpException
-
setMtime
public void setMtime(java.lang.String path, int mtime) throws SftpException
- Throws:
SftpException
-
rmdir
public void rmdir(java.lang.String path) throws SftpException
- Throws:
SftpException
-
mkdir
public void mkdir(java.lang.String path) throws SftpException
- Throws:
SftpException
-
stat
public SftpATTRS stat(java.lang.String path) throws SftpException
- Throws:
SftpException
-
_stat
private SftpATTRS _stat(byte[] path) throws SftpException
- Throws:
SftpException
-
_stat
private SftpATTRS _stat(java.lang.String path) throws SftpException
- Throws:
SftpException
-
statVFS
public SftpStatVFS statVFS(java.lang.String path) throws SftpException
- Throws:
SftpException
-
_statVFS
private SftpStatVFS _statVFS(byte[] path) throws SftpException
- Throws:
SftpException
-
_statVFS
private SftpStatVFS _statVFS(java.lang.String path) throws SftpException
- Throws:
SftpException
-
lstat
public SftpATTRS lstat(java.lang.String path) throws SftpException
- Throws:
SftpException
-
_lstat
private SftpATTRS _lstat(java.lang.String path) throws SftpException
- Throws:
SftpException
-
_realpath
private byte[] _realpath(java.lang.String path) throws SftpException, java.io.IOException, java.lang.Exception
- Throws:
SftpException
java.io.IOException
java.lang.Exception
-
setStat
public void setStat(java.lang.String path, SftpATTRS attr) throws SftpException
- Throws:
SftpException
-
_setStat
private void _setStat(java.lang.String path, SftpATTRS attr) throws SftpException
- Throws:
SftpException
-
pwd
public java.lang.String pwd() throws SftpException
- Throws:
SftpException
-
lpwd
public java.lang.String lpwd()
-
version
public java.lang.String version()
-
getHome
public java.lang.String getHome() throws SftpException
- Throws:
SftpException
-
getCwd
private java.lang.String getCwd() throws SftpException
- Throws:
SftpException
-
setCwd
private void setCwd(java.lang.String cwd)
-
read
private void read(byte[] buf, int s, int l) throws java.io.IOException, SftpException
- Throws:
java.io.IOException
SftpException
-
checkStatus
private boolean checkStatus(int[] ackid, ChannelSftp.Header header) throws java.io.IOException, SftpException
- Throws:
java.io.IOException
SftpException
-
_sendCLOSE
private boolean _sendCLOSE(byte[] handle, ChannelSftp.Header header) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendINIT
private void sendINIT() throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendREALPATH
private void sendREALPATH(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendSTAT
private void sendSTAT(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendSTATVFS
private void sendSTATVFS(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendLSTAT
private void sendLSTAT(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendFSTAT
private void sendFSTAT(byte[] handle) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendSETSTAT
private void sendSETSTAT(byte[] path, SftpATTRS attr) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendREMOVE
private void sendREMOVE(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendMKDIR
private void sendMKDIR(byte[] path, SftpATTRS attr) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendRMDIR
private void sendRMDIR(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendSYMLINK
private void sendSYMLINK(byte[] p1, byte[] p2) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendHARDLINK
private void sendHARDLINK(byte[] p1, byte[] p2) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendREADLINK
private void sendREADLINK(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendOPENDIR
private void sendOPENDIR(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendREADDIR
private void sendREADDIR(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendRENAME
private void sendRENAME(byte[] p1, byte[] p2) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendCLOSE
private void sendCLOSE(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendOPENR
private void sendOPENR(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendOPENW
private void sendOPENW(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendOPENA
private void sendOPENA(byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendOPEN
private void sendOPEN(byte[] path, int mode) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendPacketPath
private void sendPacketPath(byte fxp, byte[] path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendPacketPath
private void sendPacketPath(byte fxp, byte[] path, java.lang.String extension) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendPacketPath
private void sendPacketPath(byte fxp, byte[] p1, byte[] p2) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendPacketPath
private void sendPacketPath(byte fxp, byte[] p1, byte[] p2, java.lang.String extension) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendWRITE
private int sendWRITE(byte[] handle, long offset, byte[] data, int start, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendREAD
private void sendREAD(byte[] handle, long offset, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendREAD
private void sendREAD(byte[] handle, long offset, int length, ChannelSftp.RequestQueue rrq) throws java.lang.Exception
- Throws:
java.lang.Exception
-
putHEAD
private void putHEAD(Buffer buf, byte type, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
putHEAD
private void putHEAD(byte type, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
glob_remote
private java.util.Vector glob_remote(java.lang.String _path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
isPattern
private boolean isPattern(byte[] path)
-
glob_local
private java.util.Vector glob_local(java.lang.String _path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
throwStatusError
private void throwStatusError(Buffer buf, int i) throws SftpException
- Throws:
SftpException
-
isLocalAbsolutePath
private static boolean isLocalAbsolutePath(java.lang.String path)
-
disconnect
public void disconnect()
- Overrides:
disconnect
in classChannel
-
isPattern
private boolean isPattern(java.lang.String path, byte[][] utf8)
-
isPattern
private boolean isPattern(java.lang.String path)
-
fill
private void fill(Buffer buf, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
fill
private int fill(byte[] buf, int s, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
skip
private void skip(long foo) throws java.io.IOException
- Throws:
java.io.IOException
-
header
private ChannelSftp.Header header(Buffer buf, ChannelSftp.Header header) throws java.io.IOException
- Throws:
java.io.IOException
-
remoteAbsolutePath
private java.lang.String remoteAbsolutePath(java.lang.String path) throws SftpException
- Throws:
SftpException
-
localAbsolutePath
private java.lang.String localAbsolutePath(java.lang.String path)
-
isUnique
private java.lang.String isUnique(java.lang.String path) throws SftpException, java.lang.Exception
This method will check if the given string can be expanded to the unique string. If it can be expanded to mutiple files, SftpException will be thrown.- Returns:
- the returned string is unquoted.
- Throws:
SftpException
java.lang.Exception
-
getServerVersion
public int getServerVersion() throws SftpException
- Throws:
SftpException
-
setFilenameEncoding
public void setFilenameEncoding(java.lang.String encoding) throws SftpException
- Throws:
SftpException
-
getExtension
public java.lang.String getExtension(java.lang.String key)
-
realpath
public java.lang.String realpath(java.lang.String path) throws SftpException
- Throws:
SftpException
-
-