Package net.schmizz.sshj.sftp
Class SFTPClient
- java.lang.Object
-
- net.schmizz.sshj.sftp.SFTPClient
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
StatefulSFTPClient
public class SFTPClient extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected SFTPEngineengineprotected org.slf4j.LoggerlogLoggerprotected SFTPFileTransferxfer
-
Constructor Summary
Constructors Constructor Description SFTPClient(SFTPEngine engine)
-
Method Summary
Modifier and Type Method Description longatime(java.lang.String path)java.lang.Stringcanonicalize(java.lang.String path)voidchgrp(java.lang.String path, int gid)voidchmod(java.lang.String path, int perms)voidchown(java.lang.String path, int uid)voidclose()voidget(java.lang.String source, java.lang.String dest)voidget(java.lang.String source, LocalDestFile dest)SFTPFileTransfergetFileTransfer()SFTPEnginegetSFTPEngine()intgid(java.lang.String path)java.util.List<RemoteResourceInfo>ls(java.lang.String path)java.util.List<RemoteResourceInfo>ls(java.lang.String path, RemoteResourceFilter filter)FileAttributeslstat(java.lang.String path)voidmkdir(java.lang.String dirname)voidmkdirs(java.lang.String path)FileModemode(java.lang.String path)longmtime(java.lang.String path)RemoteFileopen(java.lang.String filename)RemoteFileopen(java.lang.String filename, java.util.Set<OpenMode> mode)RemoteFileopen(java.lang.String filename, java.util.Set<OpenMode> mode, FileAttributes attrs)java.util.Set<FilePermission>perms(java.lang.String path)voidput(java.lang.String source, java.lang.String dest)voidput(LocalSourceFile source, java.lang.String dest)java.lang.Stringreadlink(java.lang.String path)voidrename(java.lang.String oldpath, java.lang.String newpath)voidrename(java.lang.String oldpath, java.lang.String newpath, java.util.Set<RenameFlags> renameFlags)voidrm(java.lang.String filename)voidrmdir(java.lang.String dirname)voidsetattr(java.lang.String path, FileAttributes attrs)longsize(java.lang.String path)FileAttributesstat(java.lang.String path)FileAttributesstatExistence(java.lang.String path)voidsymlink(java.lang.String linkpath, java.lang.String targetpath)voidtruncate(java.lang.String path, long size)FileMode.Typetype(java.lang.String path)intuid(java.lang.String path)intversion()
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
Logger
-
engine
protected final SFTPEngine engine
-
xfer
protected final SFTPFileTransfer xfer
-
-
Constructor Detail
-
SFTPClient
public SFTPClient(SFTPEngine engine)
-
-
Method Detail
-
getSFTPEngine
public SFTPEngine getSFTPEngine()
-
getFileTransfer
public SFTPFileTransfer getFileTransfer()
-
ls
public java.util.List<RemoteResourceInfo> ls(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
ls
public java.util.List<RemoteResourceInfo> ls(java.lang.String path, RemoteResourceFilter filter) throws java.io.IOException
- Throws:
java.io.IOException
-
open
public RemoteFile open(java.lang.String filename, java.util.Set<OpenMode> mode, FileAttributes attrs) throws java.io.IOException
- Throws:
java.io.IOException
-
open
public RemoteFile open(java.lang.String filename, java.util.Set<OpenMode> mode) throws java.io.IOException
- Throws:
java.io.IOException
-
open
public RemoteFile open(java.lang.String filename) throws java.io.IOException
- Throws:
java.io.IOException
-
mkdir
public void mkdir(java.lang.String dirname) throws java.io.IOException- Throws:
java.io.IOException
-
mkdirs
public void mkdirs(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
statExistence
public FileAttributes statExistence(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
rename
public void rename(java.lang.String oldpath, java.lang.String newpath) throws java.io.IOException- Throws:
java.io.IOException
-
rename
public void rename(java.lang.String oldpath, java.lang.String newpath, java.util.Set<RenameFlags> renameFlags) throws java.io.IOException- Throws:
java.io.IOException
-
rm
public void rm(java.lang.String filename) throws java.io.IOException- Throws:
java.io.IOException
-
rmdir
public void rmdir(java.lang.String dirname) throws java.io.IOException- Throws:
java.io.IOException
-
symlink
public void symlink(java.lang.String linkpath, java.lang.String targetpath) throws java.io.IOException- Throws:
java.io.IOException
-
version
public int version()
-
setattr
public void setattr(java.lang.String path, FileAttributes attrs) throws java.io.IOException- Throws:
java.io.IOException
-
uid
public int uid(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
gid
public int gid(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
atime
public long atime(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
mtime
public long mtime(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
perms
public java.util.Set<FilePermission> perms(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
mode
public FileMode mode(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
type
public FileMode.Type type(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
readlink
public java.lang.String readlink(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
stat
public FileAttributes stat(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
lstat
public FileAttributes lstat(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
chown
public void chown(java.lang.String path, int uid) throws java.io.IOException- Throws:
java.io.IOException
-
chmod
public void chmod(java.lang.String path, int perms) throws java.io.IOException- Throws:
java.io.IOException
-
chgrp
public void chgrp(java.lang.String path, int gid) throws java.io.IOException- Throws:
java.io.IOException
-
truncate
public void truncate(java.lang.String path, long size) throws java.io.IOException- Throws:
java.io.IOException
-
canonicalize
public java.lang.String canonicalize(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
size
public long size(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
get
public void get(java.lang.String source, java.lang.String dest) throws java.io.IOException- Throws:
java.io.IOException
-
put
public void put(java.lang.String source, java.lang.String dest) throws java.io.IOException- Throws:
java.io.IOException
-
get
public void get(java.lang.String source, LocalDestFile dest) throws java.io.IOException- Throws:
java.io.IOException
-
put
public void put(LocalSourceFile source, java.lang.String dest) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-