Package net.schmizz.sshj.sftp
Class SFTPEngine
java.lang.Object
net.schmizz.sshj.sftp.SFTPEngine
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Requester
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
protected final org.slf4j.Logger
protected final LoggerFactory
Loggerstatic final int
protected int
protected final OutputStream
protected final PathHelper
protected final PacketReader
protected long
protected final Session.Subsystem
protected int
-
Constructor Summary
ConstructorsConstructorDescriptionSFTPEngine
(SessionFactory ssh) SFTPEngine
(SessionFactory ssh, String pathSep) -
Method Summary
Modifier and TypeMethodDescriptioncanonicalize
(String path) void
close()
private Response
protected LoggerFactory
int
getServerExtensionData
(String extension, String domain) int
init()
protected SFTPEngine
init
(int requestedVersion) Introduced for internal use by testcases.void
void
makeDir
(String path, FileAttributes attrs) newExtendedRequest
(String reqName) newRequest
(PacketType type) open
(String path, Set<OpenMode> modes, FileAttributes fa) protected static String
readSingleName
(Response res) Using UTF-8protected static String
readSingleName
(Response res, Charset charset) Using any character setprivate static byte[]
void
void
void
rename
(String oldPath, String newPath, Set<RenameFlags> flags) void
setAttributes
(String path, FileAttributes attrs) void
setTimeoutMs
(int timeoutMs) protected FileAttributes
stat
(PacketType pt, String path) boolean
supportsServerExtension
(String extension, String domain) void
protected void
transmit
(SFTPPacket<Request> payload)
-
Field Details
-
MAX_SUPPORTED_VERSION
public static final int MAX_SUPPORTED_VERSION- See Also:
-
DEFAULT_TIMEOUT_MS
public static final int DEFAULT_TIMEOUT_MS- See Also:
-
loggerFactory
Logger -
log
protected final org.slf4j.Logger log -
timeoutMs
protected volatile int timeoutMs -
pathHelper
-
sub
-
reader
-
out
-
reqID
protected long reqID -
operativeVersion
protected int operativeVersion -
serverExtensions
-
-
Constructor Details
-
SFTPEngine
- Throws:
SSHException
-
SFTPEngine
- Throws:
SSHException
-
-
Method Details
-
init
- Throws:
IOException
-
init
Introduced for internal use by testcases.- Parameters:
requestedVersion
-- Throws:
IOException
-
getSubsystem
-
getOperativeProtocolVersion
public int getOperativeProtocolVersion() -
supportsServerExtension
-
getServerExtensionData
-
newExtendedRequest
-
getPathHelper
- Specified by:
getPathHelper
in interfaceRequester
-
newRequest
- Specified by:
newRequest
in interfaceRequester
-
request
- Specified by:
request
in interfaceRequester
- Throws:
IOException
-
doRequest
- Throws:
IOException
-
open
- Throws:
IOException
-
open
- Throws:
IOException
-
open
- Throws:
IOException
-
openDir
- Throws:
IOException
-
setAttributes
- Throws:
IOException
-
readLink
- Throws:
IOException
-
makeDir
- Throws:
IOException
-
makeDir
- Throws:
IOException
-
symlink
- Throws:
IOException
-
remove
- Throws:
IOException
-
removeDir
- Throws:
IOException
-
stat
- Throws:
IOException
-
lstat
- Throws:
IOException
-
rename
- Throws:
IOException
-
canonicalize
- Throws:
IOException
-
setTimeoutMs
public void setTimeoutMs(int timeoutMs) -
getTimeoutMs
public int getTimeoutMs()- Specified by:
getTimeoutMs
in interfaceRequester
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getLoggerFactory
-
stat
- Throws:
IOException
-
readSingleNameAsBytes
- Throws:
IOException
-
readSingleName
Using UTF-8- Throws:
IOException
-
readSingleName
Using any character set- Throws:
IOException
-
transmit
- Throws:
IOException
-