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) classChannelSftp.HeaderclassChannelSftp.LsEntrystatic interfaceChannelSftp.LsEntrySelectorThis interface will be passed as an argument forlsmethod.private classChannelSftp.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[]ackidstatic intAPPENDprivate Bufferbufprivate intclient_versionprivate java.lang.Stringcwdprivate booleanextension_hardlinkprivate booleanextension_posix_renameprivate booleanextension_statvfsprivate java.util.Hashtableextensionsprivate java.lang.StringfEncodingprivate booleanfEncoding_is_utf8private static java.lang.Stringfile_separatorprivate static charfile_separatorcprivate static booleanfs_is_bsprivate java.lang.Stringhomeprivate booleaninteractiveprivate java.io.InputStreamio_inprivate java.lang.Stringlcwdprivate static intLOCAL_MAXIMUM_PACKET_SIZEprivate static intLOCAL_WINDOW_SIZE_MAXprivate static intMAX_MSG_LENGTHprivate Bufferobufprivate Packetopacketstatic intOVERWRITEprivate Packetpacketstatic intRESUMEprivate ChannelSftp.RequestQueuerqprivate intseqprivate intserver_versionprivate static intSSH_FILEXFER_ATTR_ACMODTIMEprivate static intSSH_FILEXFER_ATTR_EXTENDEDprivate static intSSH_FILEXFER_ATTR_PERMISSIONSprivate static intSSH_FILEXFER_ATTR_SIZEprivate static intSSH_FILEXFER_ATTR_UIDGIDstatic intSSH_FX_BAD_MESSAGEstatic intSSH_FX_CONNECTION_LOSTstatic intSSH_FX_EOFstatic intSSH_FX_FAILUREstatic intSSH_FX_NO_CONNECTIONstatic intSSH_FX_NO_SUCH_FILEstatic intSSH_FX_OKstatic intSSH_FX_OP_UNSUPPORTEDstatic intSSH_FX_PERMISSION_DENIEDprivate static intSSH_FXF_APPENDprivate static intSSH_FXF_CREATprivate static intSSH_FXF_EXCLprivate static intSSH_FXF_READprivate static intSSH_FXF_TRUNCprivate static intSSH_FXF_WRITEprivate static byteSSH_FXP_ATTRSprivate static byteSSH_FXP_CLOSEprivate static byteSSH_FXP_DATAprivate static byteSSH_FXP_EXTENDEDprivate static byteSSH_FXP_EXTENDED_REPLYprivate static byteSSH_FXP_FSETSTATprivate static byteSSH_FXP_FSTATprivate static byteSSH_FXP_HANDLEprivate static byteSSH_FXP_INITprivate static byteSSH_FXP_LSTATprivate static byteSSH_FXP_MKDIRprivate static byteSSH_FXP_NAMEprivate static byteSSH_FXP_OPENprivate static byteSSH_FXP_OPENDIRprivate static byteSSH_FXP_READprivate static byteSSH_FXP_READDIRprivate static byteSSH_FXP_READLINKprivate static byteSSH_FXP_REALPATHprivate static byteSSH_FXP_REMOVEprivate static byteSSH_FXP_RENAMEprivate static byteSSH_FXP_RMDIRprivate static byteSSH_FXP_SETSTATprivate static byteSSH_FXP_STATprivate static byteSSH_FXP_STATUSprivate static byteSSH_FXP_SYMLINKprivate static byteSSH_FXP_VERSIONprivate static byteSSH_FXP_WRITEprivate static java.lang.StringUTF8private java.lang.Stringversion-
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)voidcd(java.lang.String path)private booleancheckStatus(int[] ackid, ChannelSftp.Header header)voidchgrp(int gid, java.lang.String path)voidchmod(int permissions, java.lang.String path)voidchown(int uid, java.lang.String path)voiddisconnect()voidexit()private intfill(byte[] buf, int s, int len)private voidfill(Buffer buf, int len)java.io.InputStreamget(java.lang.String src)java.io.InputStreamget(java.lang.String src, int mode)Deprecated.This method will be deleted in the future.java.io.InputStreamget(java.lang.String src, SftpProgressMonitor monitor)java.io.InputStreamget(java.lang.String src, SftpProgressMonitor monitor, int mode)Deprecated.This method will be deleted in the future.java.io.InputStreamget(java.lang.String src, SftpProgressMonitor monitor, long skip)voidget(java.lang.String src, java.io.OutputStream dst)voidget(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor)voidget(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor, int mode, long skip)voidget(java.lang.String src, java.lang.String dst)voidget(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor)voidget(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode)intgetBulkRequests()This method will return the value how many requests may be sent at any one time.private java.lang.StringgetCwd()java.lang.StringgetExtension(java.lang.String key)java.lang.StringgetHome()intgetServerVersion()private java.util.Vectorglob_local(java.lang.String _path)private java.util.Vectorglob_remote(java.lang.String _path)voidhardlink(java.lang.String oldpath, java.lang.String newpath)private ChannelSftp.Headerheader(Buffer buf, ChannelSftp.Header header)(package private) voidinit()private static booleanisLocalAbsolutePath(java.lang.String path)private booleanisPattern(byte[] path)private booleanisPattern(java.lang.String path)private booleanisPattern(java.lang.String path, byte[][] utf8)private booleanisRemoteDir(java.lang.String path)private java.lang.StringisUnique(java.lang.String path)This method will check if the given string can be expanded to the unique string.voidlcd(java.lang.String path)private java.lang.StringlocalAbsolutePath(java.lang.String path)java.lang.Stringlpwd()java.util.Vectorls(java.lang.String path)voidls(java.lang.String path, ChannelSftp.LsEntrySelector selector)List files specified by the remotepath.SftpATTRSlstat(java.lang.String path)voidmkdir(java.lang.String path)voidput(java.io.InputStream src, java.lang.String dst)voidput(java.io.InputStream src, java.lang.String dst, int mode)voidput(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor)voidput(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode)Sends data from the input streamsrctodstfile.java.io.OutputStreamput(java.lang.String dst)java.io.OutputStreamput(java.lang.String dst, int mode)java.io.OutputStreamput(java.lang.String dst, SftpProgressMonitor monitor, int mode)java.io.OutputStreamput(java.lang.String dst, SftpProgressMonitor monitor, int mode, long offset)Sends data from the output stream todstfile.voidput(java.lang.String src, java.lang.String dst)voidput(java.lang.String src, java.lang.String dst, int mode)voidput(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor)voidput(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode)Sends data fromsrcfile todstfile.private voidputHEAD(byte type, int length)private voidputHEAD(Buffer buf, byte type, int length)java.lang.Stringpwd()voidquit()private voidread(byte[] buf, int s, int l)java.lang.Stringreadlink(java.lang.String path)java.lang.Stringrealpath(java.lang.String path)private java.lang.StringremoteAbsolutePath(java.lang.String path)voidrename(java.lang.String oldpath, java.lang.String newpath)voidrm(java.lang.String path)voidrmdir(java.lang.String path)private voidsendCLOSE(byte[] path)private voidsendFSTAT(byte[] handle)private voidsendHARDLINK(byte[] p1, byte[] p2)private voidsendINIT()private voidsendLSTAT(byte[] path)private voidsendMKDIR(byte[] path, SftpATTRS attr)private voidsendOPEN(byte[] path, int mode)private voidsendOPENA(byte[] path)private voidsendOPENDIR(byte[] path)private voidsendOPENR(byte[] path)private voidsendOPENW(byte[] path)private voidsendPacketPath(byte fxp, byte[] path)private voidsendPacketPath(byte fxp, byte[] p1, byte[] p2)private voidsendPacketPath(byte fxp, byte[] p1, byte[] p2, java.lang.String extension)private voidsendPacketPath(byte fxp, byte[] path, java.lang.String extension)private voidsendREAD(byte[] handle, long offset, int length)private voidsendREAD(byte[] handle, long offset, int length, ChannelSftp.RequestQueue rrq)private voidsendREADDIR(byte[] path)private voidsendREADLINK(byte[] path)private voidsendREALPATH(byte[] path)private voidsendREMOVE(byte[] path)private voidsendRENAME(byte[] p1, byte[] p2)private voidsendRMDIR(byte[] path)private voidsendSETSTAT(byte[] path, SftpATTRS attr)private voidsendSTAT(byte[] path)private voidsendSTATVFS(byte[] path)private voidsendSYMLINK(byte[] p1, byte[] p2)private intsendWRITE(byte[] handle, long offset, byte[] data, int start, int length)voidsetBulkRequests(int bulk_requests)Specify how many requests may be sent at any one time.private voidsetCwd(java.lang.String cwd)voidsetFilenameEncoding(java.lang.String encoding)voidsetMtime(java.lang.String path, int mtime)voidsetStat(java.lang.String path, SftpATTRS attr)private voidskip(long foo)voidstart()SftpATTRSstat(java.lang.String path)SftpStatVFSstatVFS(java.lang.String path)voidsymlink(java.lang.String oldpath, java.lang.String newpath)private voidthrowStatusError(Buffer buf, int i)java.lang.Stringversion()-
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 JSchExceptionSpecify 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:
startin 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 SftpExceptionSends data fromsrcfile todstfile. Themodeshould beOVERWRITE,RESUMEorAPPEND.- 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 SftpExceptionSends data from the input streamsrctodstfile. Themodeshould beOVERWRITE,RESUMEorAPPEND.- 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 SftpExceptionSends data from the output stream todstfile. Themodeshould beOVERWRITE,RESUMEorAPPEND.- 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 SftpExceptionDeprecated.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 SftpExceptionDeprecated.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 SftpExceptionList 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:
SftpExceptionjava.io.IOExceptionjava.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.IOExceptionSftpException
-
checkStatus
private boolean checkStatus(int[] ackid, ChannelSftp.Header header) throws java.io.IOException, SftpException- Throws:
java.io.IOExceptionSftpException
-
_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:
disconnectin 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.ExceptionThis 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:
SftpExceptionjava.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
-
-