public class

SFTPEngine

extends Object
implements Closeable Requester
java.lang.Object
   ↳ net.schmizz.sshj.sftp.SFTPEngine

Summary

Constants
int DEFAULT_TIMEOUT_MS
int MAX_SUPPORTED_VERSION
Fields
protected final Logger log Logger
protected int operativeVersion
protected final OutputStream out
protected final PathHelper pathHelper
protected final PacketReader reader
protected long reqID
protected final Map<String, String> serverExtensions
protected final Session.Subsystem sub
protected int timeoutMs
Public Constructors
SFTPEngine(SessionFactory ssh)
SFTPEngine(SessionFactory ssh, String pathSep)
Public Methods
String canonicalize(String path)
void close()
int getOperativeProtocolVersion()
PathHelper getPathHelper()
Session.Subsystem getSubsystem()
int getTimeoutMs()
SFTPEngine init()
FileAttributes lstat(String path)
void makeDir(String path)
void makeDir(String path, FileAttributes attrs)
Request newExtendedRequest(String reqName)
synchronized Request newRequest(PacketType type)
RemoteFile open(String filename, Set<OpenMode> modes)
RemoteFile open(String filename)
RemoteFile open(String path, Set<OpenMode> modes, FileAttributes fa)
RemoteDirectory openDir(String path)
String readLink(String path)
void remove(String filename)
void removeDir(String path)
void rename(String oldPath, String newPath)
Promise<ResponseSFTPException> request(Request req)
void setAttributes(String path, FileAttributes attrs)
void setTimeoutMs(int timeoutMs)
FileAttributes stat(String path)
void symlink(String linkpath, String targetpath)
Protected Methods
static String readSingleName(Response res)
FileAttributes stat(PacketType pt, String path)
synchronized void transmit(SFTPPacket<Request> payload)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.io.Closeable
From interface net.schmizz.sshj.sftp.Requester

Constants

public static final int DEFAULT_TIMEOUT_MS

Constant Value: 30000 (0x00007530)

public static final int MAX_SUPPORTED_VERSION

Constant Value: 3 (0x00000003)

Fields

protected final Logger log

Logger

protected int operativeVersion

protected final OutputStream out

protected final PathHelper pathHelper

protected final PacketReader reader

protected long reqID

protected final Map<String, String> serverExtensions

protected final Session.Subsystem sub

protected int timeoutMs

Public Constructors

public SFTPEngine (SessionFactory ssh)

Parameters
ssh
Throws
SSHException

public SFTPEngine (SessionFactory ssh, String pathSep)

Parameters
ssh
pathSep
Throws
SSHException

Public Methods

public String canonicalize (String path)

Parameters
path
Throws
IOException

public void close ()

Throws
IOException

public int getOperativeProtocolVersion ()

public PathHelper getPathHelper ()

public Session.Subsystem getSubsystem ()

public int getTimeoutMs ()

public SFTPEngine init ()

Throws
IOException

public FileAttributes lstat (String path)

Parameters
path
Throws
IOException

public void makeDir (String path)

Parameters
path
Throws
IOException

public void makeDir (String path, FileAttributes attrs)

Parameters
path
attrs
Throws
IOException

public Request newExtendedRequest (String reqName)

Parameters
reqName

public synchronized Request newRequest (PacketType type)

Parameters
type

public RemoteFile open (String filename, Set<OpenMode> modes)

Parameters
filename
modes
Throws
IOException

public RemoteFile open (String filename)

Parameters
filename
Throws
IOException

public RemoteFile open (String path, Set<OpenMode> modes, FileAttributes fa)

Parameters
path
modes
fa
Throws
IOException

public RemoteDirectory openDir (String path)

Parameters
path
Throws
IOException

public String readLink (String path)

Parameters
path
Throws
IOException

public void remove (String filename)

Parameters
filename
Throws
IOException

public void removeDir (String path)

Parameters
path
Throws
IOException

public void rename (String oldPath, String newPath)

Parameters
oldPath
newPath
Throws
IOException

public Promise<ResponseSFTPException> request (Request req)

Parameters
req
Throws
IOException

public void setAttributes (String path, FileAttributes attrs)

Parameters
path
attrs
Throws
IOException

public void setTimeoutMs (int timeoutMs)

Parameters
timeoutMs

public FileAttributes stat (String path)

Parameters
path
Throws
IOException

public void symlink (String linkpath, String targetpath)

Parameters
linkpath
targetpath
Throws
IOException

Protected Methods

protected static String readSingleName (Response res)

Parameters
res
Throws
IOException

protected FileAttributes stat (PacketType pt, String path)

Parameters
pt
path
Throws
IOException

protected synchronized void transmit (SFTPPacket<Request> payload)

Parameters
payload
Throws
IOException