|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jcraft.jsch.Channel com.jcraft.jsch.ChannelSftp
public class ChannelSftp
Nested Class Summary | |
---|---|
class |
ChannelSftp.LsEntry
|
static interface |
ChannelSftp.LsEntrySelector
This interface will be passed as an argument for ls method. |
Field Summary | |
---|---|
protected boolean |
agent_forwarding
|
static int |
APPEND
|
protected java.util.Hashtable |
env
|
static int |
OVERWRITE
|
protected boolean |
pty
|
static int |
RESUME
|
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
|
protected int |
tcol
|
protected byte[] |
terminal_mode
|
protected int |
thp
|
protected int |
trow
|
protected java.lang.String |
ttype
|
protected int |
twp
|
protected boolean |
xforwading
|
Fields inherited from class com.jcraft.jsch.Channel |
---|
type |
Constructor Summary | |
---|---|
ChannelSftp()
|
Method Summary | |
---|---|
void |
_put(java.io.InputStream src,
java.lang.String dst,
SftpProgressMonitor monitor,
int mode)
|
void |
cd(java.lang.String path)
|
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()
|
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. |
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)
|
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.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. |
java.lang.String |
getExtension(java.lang.String key)
|
java.lang.String |
getHome()
|
int |
getServerVersion()
|
void |
hardlink(java.lang.String oldpath,
java.lang.String newpath)
|
void |
lcd(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 remote path . |
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 stream src to dst 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 to dst 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 from src file to dst file. |
java.lang.String |
pwd()
|
void |
quit()
|
java.lang.String |
readlink(java.lang.String path)
|
java.lang.String |
realpath(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)
|
void |
run()
|
protected void |
sendRequests()
|
void |
setAgentForwarding(boolean enable)
Enable the agent forwarding. |
void |
setBulkRequests(int bulk_requests)
Specify how many requests may be sent at any one time. |
void |
setEnv(byte[] name,
byte[] value)
Set the environment variable. |
void |
setEnv(java.util.Hashtable env)
Deprecated. Use setEnv(String, String) or setEnv(byte[], byte[]) instead. |
void |
setEnv(java.lang.String name,
java.lang.String value)
Set the environment variable. |
void |
setFilenameEncoding(java.lang.String encoding)
|
void |
setMtime(java.lang.String path,
int mtime)
|
void |
setPty(boolean enable)
Allocate a Pseudo-Terminal. |
void |
setPtySize(int col,
int row,
int wp,
int hp)
Change the window dimension interactively. |
void |
setPtyType(java.lang.String ttype)
Set the terminal type. |
void |
setPtyType(java.lang.String ttype,
int col,
int row,
int wp,
int hp)
Set the terminal type. |
void |
setStat(java.lang.String path,
SftpATTRS attr)
|
void |
setTerminalMode(byte[] terminal_mode)
Set the terminal mode. |
void |
setXForwarding(boolean enable)
Enable the X11 forwarding. |
void |
start()
|
SftpATTRS |
stat(java.lang.String path)
|
SftpStatVFS |
statVFS(java.lang.String path)
|
void |
symlink(java.lang.String oldpath,
java.lang.String newpath)
|
java.lang.String |
version()
|
Methods inherited from class com.jcraft.jsch.Channel |
---|
connect, connect, genChannelOpenPacket, getExitStatus, getExtInputStream, getId, getInputStream, getOutputStream, getSession, isClosed, isConnected, isEOF, sendChannelOpen, sendOpenConfirmation, sendOpenFailure, sendSignal, setExtOutputStream, setExtOutputStream, setInputStream, setInputStream, setOutputStream, setOutputStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 OVERWRITE
public static final int RESUME
public static final int APPEND
protected boolean agent_forwarding
protected boolean xforwading
protected java.util.Hashtable env
protected boolean pty
protected java.lang.String ttype
protected int tcol
protected int trow
protected int twp
protected int thp
protected byte[] terminal_mode
Constructor Detail |
---|
public ChannelSftp()
Method Detail |
---|
public void setBulkRequests(int bulk_requests) throws JSchException
bulk_requests
- how many requests may be outstanding at any one time.
JSchException
public int getBulkRequests()
public void start() throws JSchException
start
in class Channel
JSchException
public void quit()
public void exit()
public void lcd(java.lang.String path) throws SftpException
SftpException
public void cd(java.lang.String path) throws SftpException
SftpException
public void put(java.lang.String src, java.lang.String dst) throws SftpException
SftpException
public void put(java.lang.String src, java.lang.String dst, int mode) throws SftpException
SftpException
public void put(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor) throws SftpException
SftpException
public void put(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
src
file to dst
file.
The mode
should be OVERWRITE
,
RESUME
or APPEND
.
src
- source filedst
- destination filemonitor
- progress monitormode
- how data should be added to dst
SftpException
public void put(java.io.InputStream src, java.lang.String dst) throws SftpException
SftpException
public void put(java.io.InputStream src, java.lang.String dst, int mode) throws SftpException
SftpException
public void put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor) throws SftpException
SftpException
public void put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
src
to dst
file.
The mode
should be OVERWRITE
,
RESUME
or APPEND
.
src
- input streamdst
- destination filemonitor
- progress monitormode
- how data should be added to dst
SftpException
public void _put(java.io.InputStream src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
SftpException
public java.io.OutputStream put(java.lang.String dst) throws SftpException
SftpException
public java.io.OutputStream put(java.lang.String dst, int mode) throws SftpException
SftpException
public java.io.OutputStream put(java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
SftpException
public java.io.OutputStream put(java.lang.String dst, SftpProgressMonitor monitor, int mode, long offset) throws SftpException
dst
file.
The mode
should be OVERWRITE
,
RESUME
or APPEND
.
dst
- destination filemonitor
- progress monitormode
- how data should be added to dstoffset
- data will be added at offset
SftpException
public void get(java.lang.String src, java.lang.String dst) throws SftpException
SftpException
public void get(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor) throws SftpException
SftpException
public void get(java.lang.String src, java.lang.String dst, SftpProgressMonitor monitor, int mode) throws SftpException
SftpException
public void get(java.lang.String src, java.io.OutputStream dst) throws SftpException
SftpException
public void get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor) throws SftpException
SftpException
public void get(java.lang.String src, java.io.OutputStream dst, SftpProgressMonitor monitor, int mode, long skip) throws SftpException
SftpException
public java.io.InputStream get(java.lang.String src) throws SftpException
SftpException
public java.io.InputStream get(java.lang.String src, SftpProgressMonitor monitor) throws SftpException
SftpException
public java.io.InputStream get(java.lang.String src, int mode) throws SftpException
SftpException
public java.io.InputStream get(java.lang.String src, SftpProgressMonitor monitor, int mode) throws SftpException
SftpException
public java.io.InputStream get(java.lang.String src, SftpProgressMonitor monitor, long skip) throws SftpException
SftpException
public java.util.Vector ls(java.lang.String path) throws SftpException
SftpException
public void ls(java.lang.String path, ChannelSftp.LsEntrySelector selector) throws SftpException
path
.
Each files and directories will be passed to
LsEntrySelector#select(LsEntry)
method, and if that method
returns LsEntrySelector#BREAK
, the operation will be
canceled immediately.
SftpException
ChannelSftp.LsEntrySelector
public java.lang.String readlink(java.lang.String path) throws SftpException
SftpException
public void symlink(java.lang.String oldpath, java.lang.String newpath) throws SftpException
SftpException
public void hardlink(java.lang.String oldpath, java.lang.String newpath) throws SftpException
SftpException
public void rename(java.lang.String oldpath, java.lang.String newpath) throws SftpException
SftpException
public void rm(java.lang.String path) throws SftpException
SftpException
public void chgrp(int gid, java.lang.String path) throws SftpException
SftpException
public void chown(int uid, java.lang.String path) throws SftpException
SftpException
public void chmod(int permissions, java.lang.String path) throws SftpException
SftpException
public void setMtime(java.lang.String path, int mtime) throws SftpException
SftpException
public void rmdir(java.lang.String path) throws SftpException
SftpException
public void mkdir(java.lang.String path) throws SftpException
SftpException
public SftpATTRS stat(java.lang.String path) throws SftpException
SftpException
public SftpStatVFS statVFS(java.lang.String path) throws SftpException
SftpException
public SftpATTRS lstat(java.lang.String path) throws SftpException
SftpException
public void setStat(java.lang.String path, SftpATTRS attr) throws SftpException
SftpException
public java.lang.String pwd() throws SftpException
SftpException
public java.lang.String lpwd()
public java.lang.String version()
public java.lang.String getHome() throws SftpException
SftpException
public void disconnect()
disconnect
in class Channel
public int getServerVersion() throws SftpException
SftpException
public void setFilenameEncoding(java.lang.String encoding) throws SftpException
SftpException
public java.lang.String getExtension(java.lang.String key)
public java.lang.String realpath(java.lang.String path) throws SftpException
SftpException
public void setAgentForwarding(boolean enable)
enable
- public void setXForwarding(boolean enable)
setXForwarding
in class Channel
enable
- public void setEnv(java.util.Hashtable env)
setEnv(String, String)
or setEnv(byte[], byte[])
instead.
setEnv(String, String)
,
setEnv(byte[], byte[])
public void setEnv(java.lang.String name, java.lang.String value)
name
and value
are needed to be passed
to the remote in your favorite encoding,
use setEnv(byte[], byte[])
.
Refer to RFC4254 6.4 Environment Variable Passing.
name
- A name for environment variable.value
- A value for environment variable.public void setEnv(byte[] name, byte[] value)
name
- A name of environment variable.value
- A value of environment variable.setEnv(String, String)
public void setPty(boolean enable)
enable
- public void setTerminalMode(byte[] terminal_mode)
terminal_mode
- public void setPtySize(int col, int row, int wp, int hp)
col
- terminal width, columnsrow
- terminal height, rowswp
- terminal width, pixelshp
- terminal height, pixelspublic void setPtyType(java.lang.String ttype)
ttype
- terminal type(for example, "vt100")setPtyType(String, int, int, int, int)
public void setPtyType(java.lang.String ttype, int col, int row, int wp, int hp)
ttype
- terminal type(for example, "vt100")col
- terminal width, columnsrow
- terminal height, rowswp
- terminal width, pixelshp
- terminal height, pixelsprotected void sendRequests() throws java.lang.Exception
java.lang.Exception
public void run()
run
in interface java.lang.Runnable
run
in class Channel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |