Class SftpClient
- java.lang.Object
-
- com.openindex.openestate.tool.utils.SftpClient
-
public class SftpClient extends Object
SftpClient.- Author:
- Andreas Rudolph
-
-
Constructor Summary
Constructors Constructor Description SftpClient(com.jcraft.jsch.Session session)
SftpClient(String host, int port, String user, com.jcraft.jsch.UserInfo userInfo)
SftpClient(String host, int port, String user, String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cd(String path)
void
cdUp()
void
chgrp(int gid, String path)
void
chmod(int permissions, String path)
void
chmod(String permissions, String path)
void
chown(int uid, String path)
void
connect()
void
disconnect()
void
exit()
void
get(String src, OutputStream dst)
void
get(String src, OutputStream dst, com.jcraft.jsch.SftpProgressMonitor monitor)
void
get(String src, String dst)
void
get(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor)
String
getHome()
void
hardlink(String oldpath, String newpath)
boolean
isConnected()
List<com.jcraft.jsch.ChannelSftp.LsEntry>
ls()
List<com.jcraft.jsch.ChannelSftp.LsEntry>
ls(String path)
void
mkdir(String path)
void
put(InputStream src, String dst)
void
put(InputStream src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor)
void
put(String src, String dst)
void
put(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor)
String
pwd()
void
rename(String oldpath, String newpath)
void
rm(String path)
void
rmdir(String path)
void
rmdir(String path, boolean recursive)
void
setModificationTime(String path, int time)
com.jcraft.jsch.SftpATTRS
stat(String path)
void
symlink(String oldpath, String newpath)
-
-
-
Constructor Detail
-
SftpClient
public SftpClient(String host, int port, String user, String password) throws IOException
- Throws:
IOException
-
SftpClient
public SftpClient(String host, int port, String user, com.jcraft.jsch.UserInfo userInfo) throws IOException
- Throws:
IOException
-
SftpClient
public SftpClient(com.jcraft.jsch.Session session) throws IOException
- Throws:
IOException
-
-
Method Detail
-
cd
public void cd(String path) throws IOException
- Throws:
IOException
-
cdUp
public void cdUp() throws IOException
- Throws:
IOException
-
chgrp
public void chgrp(int gid, String path) throws IOException
- Throws:
IOException
-
chmod
public void chmod(int permissions, String path) throws IOException
- Throws:
IOException
-
chmod
public void chmod(String permissions, String path) throws IOException
- Throws:
IOException
-
chown
public void chown(int uid, String path) throws IOException
- Throws:
IOException
-
connect
public void connect() throws IOException, SshUtils.AuthenticationFailedException, SshUtils.ConnectionFailedException
-
disconnect
public void disconnect()
-
exit
public void exit()
-
get
public void get(String src, String dst) throws IOException
- Throws:
IOException
-
get
public void get(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws IOException
- Throws:
IOException
-
get
public void get(String src, OutputStream dst) throws IOException
- Throws:
IOException
-
get
public void get(String src, OutputStream dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws IOException
- Throws:
IOException
-
getHome
public String getHome() throws IOException
- Throws:
IOException
-
hardlink
public void hardlink(String oldpath, String newpath) throws IOException
- Throws:
IOException
-
isConnected
public boolean isConnected()
-
ls
public List<com.jcraft.jsch.ChannelSftp.LsEntry> ls() throws IOException
- Throws:
IOException
-
ls
public List<com.jcraft.jsch.ChannelSftp.LsEntry> ls(String path) throws IOException
- Throws:
IOException
-
mkdir
public void mkdir(String path) throws IOException
- Throws:
IOException
-
put
public void put(String src, String dst) throws IOException
- Throws:
IOException
-
put
public void put(String src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws IOException
- Throws:
IOException
-
put
public void put(InputStream src, String dst) throws IOException
- Throws:
IOException
-
put
public void put(InputStream src, String dst, com.jcraft.jsch.SftpProgressMonitor monitor) throws IOException
- Throws:
IOException
-
pwd
public String pwd() throws IOException
- Throws:
IOException
-
rename
public void rename(String oldpath, String newpath) throws IOException
- Throws:
IOException
-
rm
public void rm(String path) throws IOException
- Throws:
IOException
-
rmdir
public void rmdir(String path) throws IOException
- Throws:
IOException
-
rmdir
public void rmdir(String path, boolean recursive) throws IOException
- Throws:
IOException
-
setModificationTime
public void setModificationTime(String path, int time) throws IOException
- Throws:
IOException
-
stat
public com.jcraft.jsch.SftpATTRS stat(String path) throws IOException
- Throws:
IOException
-
symlink
public void symlink(String oldpath, String newpath) throws IOException
- Throws:
IOException
-
-