Package com.logicaldoc.importfolder.sftp
Class SFTPClient
- java.lang.Object
-
- com.logicaldoc.importfolder.sftp.SFTPClient
-
public class SFTPClient extends Object
Wrapper over SFTP client- Since:
- 8.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description SFTPClient(com.jcraft.jsch.Session session, com.jcraft.jsch.Channel channel, com.jcraft.jsch.ChannelSftp channelSftp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
_put(InputStream arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3)
void
cd(String arg0)
void
chgrp(int arg0, String arg1)
void
chmod(int arg0, String arg1)
void
chown(int arg0, String arg1)
void
connect()
void
connect(int arg0)
void
disconnect()
boolean
equals(Object obj)
void
exit()
InputStream
get(String src)
InputStream
get(String src, int mode)
InputStream
get(String src, com.jcraft.jsch.SftpProgressMonitor monitor)
InputStream
get(String src, com.jcraft.jsch.SftpProgressMonitor monitor, int mode)
InputStream
get(String arg0, com.jcraft.jsch.SftpProgressMonitor arg1, long arg2)
void
get(String src, OutputStream dst)
void
get(String src, OutputStream dst, com.jcraft.jsch.SftpProgressMonitor monitor)
void
get(String arg0, OutputStream arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3, long arg4)
void
get(String src, String dst)
void
get(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor)
void
get(String arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3)
int
getBulkRequests()
int
getExitStatus()
String
getExtension(String key)
InputStream
getExtInputStream()
String
getHome()
int
getId()
InputStream
getInputStream()
OutputStream
getOutputStream()
int
getServerVersion()
com.jcraft.jsch.Session
getSession()
void
hardlink(String arg0, String arg1)
int
hashCode()
boolean
isClosed()
boolean
isConnected()
boolean
isEOF()
void
lcd(String arg0)
void
logout()
String
lpwd()
Vector
ls(String path)
void
ls(String arg0, com.jcraft.jsch.ChannelSftp.LsEntrySelector arg1)
com.jcraft.jsch.SftpATTRS
lstat(String arg0)
void
mkdir(String arg0)
void
put(InputStream src, String dst)
void
put(InputStream src, String dst, int mode)
void
put(InputStream src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor)
void
put(InputStream arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3)
OutputStream
put(String dst)
OutputStream
put(String dst, int mode)
OutputStream
put(String dst, com.jcraft.jsch.SftpProgressMonitor monitor, int mode)
OutputStream
put(String arg0, com.jcraft.jsch.SftpProgressMonitor arg1, int arg2, long arg3)
void
put(String src, String dst)
void
put(String src, String dst, int mode)
void
put(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor)
void
put(String arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3)
String
pwd()
void
quit()
String
readlink(String arg0)
String
realpath(String arg0)
void
rename(String arg0, String arg1)
void
retrieveFile(String path, OutputStream os)
void
rm(String arg0)
void
rmdir(String arg0)
void
run()
void
sendSignal(String signal)
void
setAgentForwarding(boolean enable)
void
setBulkRequests(int bulk_requests)
void
setEnv(byte[] name, byte[] value)
void
setEnv(String name, String value)
void
setEnv(Hashtable env)
void
setExtOutputStream(OutputStream out)
void
setExtOutputStream(OutputStream out, boolean dontclose)
void
setFilenameEncoding(String encoding)
void
setInputStream(InputStream in)
void
setInputStream(InputStream in, boolean dontclose)
void
setMtime(String arg0, int arg1)
void
setOutputStream(OutputStream out)
void
setOutputStream(OutputStream out, boolean dontclose)
void
setPty(boolean enable)
void
setPtySize(int arg0, int arg1, int arg2, int arg3)
void
setPtyType(String ttype)
void
setPtyType(String ttype, int col, int row, int wp, int hp)
void
setStat(String arg0, com.jcraft.jsch.SftpATTRS arg1)
void
setTerminalMode(byte[] terminal_mode)
void
setXForwarding(boolean enable)
void
start()
com.jcraft.jsch.SftpATTRS
stat(String arg0)
com.jcraft.jsch.SftpStatVFS
statVFS(String arg0)
void
symlink(String arg0, String arg1)
String
toString()
String
version()
-
-
-
Method Detail
-
_put
public void _put(InputStream arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
cd
public void cd(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
chgrp
public void chgrp(int arg0, String arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
chmod
public void chmod(int arg0, String arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
chown
public void chown(int arg0, String arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
connect
public void connect() throws com.jcraft.jsch.JSchException
- Throws:
com.jcraft.jsch.JSchException
-
connect
public void connect(int arg0) throws com.jcraft.jsch.JSchException
- Throws:
com.jcraft.jsch.JSchException
-
disconnect
public void disconnect()
-
exit
public void exit()
-
get
public InputStream get(String src, int mode) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public void get(String arg0, OutputStream arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3, long arg4) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public void get(String src, OutputStream dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public void get(String src, OutputStream dst) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public InputStream get(String src, com.jcraft.jsch.SftpProgressMonitor monitor, int mode) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public InputStream get(String arg0, com.jcraft.jsch.SftpProgressMonitor arg1, long arg2) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public InputStream get(String src, com.jcraft.jsch.SftpProgressMonitor monitor) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public void get(String arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public void get(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public void get(String src, String dst) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
get
public InputStream get(String src) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
getBulkRequests
public int getBulkRequests()
-
getExitStatus
public int getExitStatus()
-
getExtInputStream
public InputStream getExtInputStream() throws IOException
- Throws:
IOException
-
getHome
public String getHome() throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
getId
public int getId()
-
getInputStream
public InputStream getInputStream() throws IOException
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Throws:
IOException
-
getServerVersion
public int getServerVersion() throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
getSession
public com.jcraft.jsch.Session getSession() throws com.jcraft.jsch.JSchException
- Throws:
com.jcraft.jsch.JSchException
-
hardlink
public void hardlink(String arg0, String arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
isClosed
public boolean isClosed()
-
isConnected
public boolean isConnected()
-
isEOF
public boolean isEOF()
-
lcd
public void lcd(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
lpwd
public String lpwd()
-
ls
public void ls(String arg0, com.jcraft.jsch.ChannelSftp.LsEntrySelector arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
ls
public Vector ls(String path) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
lstat
public com.jcraft.jsch.SftpATTRS lstat(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
mkdir
public void mkdir(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(InputStream src, String dst, int mode) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(InputStream arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(InputStream src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(InputStream src, String dst) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public OutputStream put(String dst, int mode) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public OutputStream put(String arg0, com.jcraft.jsch.SftpProgressMonitor arg1, int arg2, long arg3) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public OutputStream put(String dst, com.jcraft.jsch.SftpProgressMonitor monitor, int mode) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(String src, String dst, int mode) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(String arg0, String arg1, com.jcraft.jsch.SftpProgressMonitor arg2, int arg3) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public void put(String src, String dst) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
put
public OutputStream put(String dst) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
pwd
public String pwd() throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
quit
public void quit()
-
readlink
public String readlink(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
realpath
public String realpath(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
rename
public void rename(String arg0, String arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
rm
public void rm(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
rmdir
public void rmdir(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
run
public void run()
-
setAgentForwarding
public void setAgentForwarding(boolean enable)
-
setBulkRequests
public void setBulkRequests(int bulk_requests) throws com.jcraft.jsch.JSchException
- Throws:
com.jcraft.jsch.JSchException
-
setEnv
public void setEnv(byte[] name, byte[] value)
-
setEnv
public void setEnv(Hashtable env)
-
setExtOutputStream
public void setExtOutputStream(OutputStream out, boolean dontclose)
-
setExtOutputStream
public void setExtOutputStream(OutputStream out)
-
setFilenameEncoding
public void setFilenameEncoding(String encoding) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
setInputStream
public void setInputStream(InputStream in, boolean dontclose)
-
setInputStream
public void setInputStream(InputStream in)
-
setMtime
public void setMtime(String arg0, int arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
setOutputStream
public void setOutputStream(OutputStream out, boolean dontclose)
-
setOutputStream
public void setOutputStream(OutputStream out)
-
setPty
public void setPty(boolean enable)
-
setPtySize
public void setPtySize(int arg0, int arg1, int arg2, int arg3)
-
setPtyType
public void setPtyType(String ttype, int col, int row, int wp, int hp)
-
setPtyType
public void setPtyType(String ttype)
-
setStat
public void setStat(String arg0, com.jcraft.jsch.SftpATTRS arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
setTerminalMode
public void setTerminalMode(byte[] terminal_mode)
-
setXForwarding
public void setXForwarding(boolean enable)
-
start
public void start() throws com.jcraft.jsch.JSchException
- Throws:
com.jcraft.jsch.JSchException
-
stat
public com.jcraft.jsch.SftpATTRS stat(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
statVFS
public com.jcraft.jsch.SftpStatVFS statVFS(String arg0) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
symlink
public void symlink(String arg0, String arg1) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
version
public String version()
-
retrieveFile
public void retrieveFile(String path, OutputStream os) throws com.jcraft.jsch.SftpException
- Throws:
com.jcraft.jsch.SftpException
-
logout
public void logout()
-
-