public class SftpSubsystemChannel extends SubsystemChannel
// Create an SshClient
SshConnector con = SshConnector.getInstance();
// Connect and authenticate an SshClient
SshClient ssh = con.connect(....);
....
// Create and initialize an SftpSubsystemChannel
SshSession session = ssh.openSessionChannel();
if(session instanceof Ssh2Session)
((Ssh2Session)session).startSubsystem("sftp");
else
session.executeCommand("/usr/sbin/sftp-server");
SftpSubsystemChannel sftp = new SftpSubsystemChannel(session);
sftp.initialize();
The above example demonstrates how to execute subsystem on both
SSH1 and SSH2 connections. There is no subsystem support within SSH1 which
requires that the command be executed directly.| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
static int |
MAX_VERSION |
static int |
OPEN_APPEND
File open flag, forces all writes to append data at the end of the file.
|
static int |
OPEN_CREATE
File open flag, if specified a new file will be created if one does not
already exist.
|
static int |
OPEN_EXCLUSIVE
File open flag, causes an open request to fail if the named file already
exists.
|
static int |
OPEN_READ
File open flag, opens the file for reading.
|
static int |
OPEN_TEXT
File open flag, causes the file to be opened in text mode.
|
static int |
OPEN_TRUNCATE
File open flag, forces an existing file with the same name to be
truncated to zero length when creating a file by specifying OPEN_CREATE.
|
static int |
OPEN_WRITE
File open flag, opens the file for writing.
|
boolean |
PROCESSING_PATHS |
static int |
SSH_FXF_ACCESS_APPEND_DATA |
static int |
SSH_FXF_ACCESS_APPEND_DATA_ATOMIC |
static int |
SSH_FXF_ACCESS_AUDIT_ALARM_INFO |
static int |
SSH_FXF_ACCESS_BACKUP |
static int |
SSH_FXF_ACCESS_BLOCK_ADVISORY |
static int |
SSH_FXF_ACCESS_BLOCK_DELETE |
static int |
SSH_FXF_ACCESS_BLOCK_READ |
static int |
SSH_FXF_ACCESS_BLOCK_WRITE |
static int |
SSH_FXF_ACCESS_DISPOSITION
Version 5 new flags
|
static int |
SSH_FXF_ACCESS_TEXT_MODE |
static int |
SSH_FXF_BACKUP_STREAM |
static int |
SSH_FXF_CREATE_NEW |
static int |
SSH_FXF_CREATE_TRUNCATE |
static int |
SSH_FXF_DELETE_ON_CLOSE |
static int |
SSH_FXF_NOFOLLOW |
static int |
SSH_FXF_OPEN_EXISTING |
static int |
SSH_FXF_OPEN_OR_CREATE |
static int |
SSH_FXF_OVERRIDE_OWNER |
static int |
SSH_FXF_TRUNCATE_EXISTING |
static int |
SSH_FXP_ATTRS |
static int |
SSH_FXP_BLOCK |
static int |
SSH_FXP_CLOSE |
static int |
SSH_FXP_DATA |
static int |
SSH_FXP_EXTENDED |
static int |
SSH_FXP_EXTENDED_REPLY |
static int |
SSH_FXP_FSETSTAT |
static int |
SSH_FXP_FSTAT |
static int |
SSH_FXP_HANDLE |
static int |
SSH_FXP_INIT |
static int |
SSH_FXP_LINK |
static int |
SSH_FXP_LSTAT |
static int |
SSH_FXP_MKDIR |
static int |
SSH_FXP_NAME |
static int |
SSH_FXP_OPEN |
static int |
SSH_FXP_OPENDIR |
static int |
SSH_FXP_READ |
static int |
SSH_FXP_READDIR |
static int |
SSH_FXP_READLINK |
static int |
SSH_FXP_REALPATH |
static int |
SSH_FXP_REMOVE |
static int |
SSH_FXP_RENAME |
static int |
SSH_FXP_RENAME_ATOMIC |
static int |
SSH_FXP_RENAME_NATIVE |
static int |
SSH_FXP_RENAME_OVERWRITE |
static int |
SSH_FXP_RMDIR |
static int |
SSH_FXP_SETSTAT |
static int |
SSH_FXP_STAT |
static int |
SSH_FXP_STATUS |
static int |
SSH_FXP_SYMLINK |
static int |
SSH_FXP_UNBLOCK |
static int |
SSH_FXP_VERSION |
static int |
SSH_FXP_WRITE |
static int |
STATUS_FX_EOF |
static int |
STATUS_FX_OK |
protected int |
version |
channel| Constructor and Description |
|---|
SftpSubsystemChannel(SshSession session) |
SftpSubsystemChannel(SshSession session,
int maximumVersion) |
SftpSubsystemChannel(SshSession session,
int maximumVersion,
int timeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
changePermissions(SftpFile file,
int permissions)
Change the permissions of a file.
|
void |
changePermissions(String filename,
int permissions)
Change the permissions of a file.
|
void |
changePermissions(String filename,
String permissions)
Change the permissions of a file.
|
void |
close()
Close the subsystem
|
void |
closeFile(SftpFile file)
Close a file or directory.
|
void |
createLink(String targetpath,
String linkpath,
boolean symbolic)
Create a symbolic link.
|
void |
createSymbolicLink(String targetpath,
String linkpath)
Create a symbolic link.
|
void |
disableVerification() |
void |
enableVerification() |
protected SftpFileAttributes |
extractAttributes(UnsignedInteger32 requestId,
SftpMessage bar) |
String |
getAbsolutePath(SftpFile file)
Get the absolute path of a file.
|
String |
getAbsolutePath(String path)
Get the absolute path of a file.
|
SftpFileAttributes |
getAttributes(SftpFile file)
Get the attributes of a file.
|
SftpFileAttributes |
getAttributes(String path)
Get the attributes of a file.
|
protected SftpFileAttributes |
getAttributes(String path,
int messageId,
String messageName) |
byte[] |
getCanonicalNewline()
Returns the canonical newline convention in use when reading/writing text
files.
|
String |
getCharsetEncoding()
Get the current encoding being used for filename Strings.
|
String |
getDefaultDirectory()
Gets the users default directory.
|
protected SftpFileAttributes |
getDefaultDirectoryPermissions() |
byte[] |
getExtension(String name)
Get the data value of a supported SFTP extension.
|
SftpMessage |
getExtensionResponse(UnsignedInteger32 requestId) |
SftpFile |
getFile(String path)
Utility method to obtain an
SftpFile instance for a given path. |
byte[] |
getHandleResponse(SftpMessage bar,
UnsignedInteger32 requestId) |
byte[] |
getHandleResponse(UnsignedInteger32 requestId) |
SftpFileAttributes |
getLinkAttributes(String path)
Get the attributes of a file.
|
int |
getMaximumLocalPacketLength() |
long |
getMaximumLocalWindowSize() |
int |
getMaximumRemotePacketLength() |
long |
getMaximumRemoteWindowSize() |
void |
getOKRequestStatus(UnsignedInteger32 requestId)
Verify that an OK status has been returned for a request id.
|
SftpMessage |
getResponse(UnsignedInteger32 requestId) |
int |
getServerVersion()
Version 4 of the SFTP protocol allows the server to return its maximum
supported version instead of the actual version to be used.
|
SftpFile |
getSingleFileResponse(SftpMessage bar,
String messageName)
Get a single SftpFile object from a message returning SSH_FXP_NAME result.
|
protected static String |
getStatusDescription(ByteArrayReader msg) |
String |
getSymbolicLinkTarget(String linkpath)
Get the target path of a symbolic link.
|
TransportProtocol |
getTransport() |
int |
getVersion()
When called after the initialize method this
will return the version in operation for this sftp session.
|
void |
initialize()
Initializes the sftp subsystem and negotiates a version with the server.
|
int |
listChildren(SftpFile file,
Vector<SftpFile> children)
List the children of a directory.
|
int |
listChildren(SftpFile file,
Vector<SftpFile> children,
boolean disableAttributeCheck) |
void |
lockFile(byte[] handle,
long offset,
long length,
int lockFlags) |
void |
makeDirectory(String path)
Make a directory.
|
void |
makeDirectory(String path,
SftpFileAttributes attrs)
Make a directory.
|
SftpFile |
openDirectory(String path)
Open a directory.
|
SftpFile |
openDirectory(String path,
boolean disableAttributeCheck)
Open a directory.
|
SftpFile |
openFile(String absolutePath,
int flags)
Open a file.
|
SftpFile |
openFile(String absolutePath,
int flags,
SftpFileAttributes attrs)
Open a file.
|
SftpFile |
openFileVersion5(String absolutePath,
int flags,
int accessFlags,
SftpFileAttributes attrs) |
void |
performOptimizedRead(byte[] handle,
long length,
int blocksize,
OutputStream out,
int outstandingRequests,
FileTransferProgress progress)
Performs an optimized read of a file through use of asynchronous
messages.
|
void |
performOptimizedRead(byte[] handle,
long length,
int blocksize,
OutputStream out,
int outstandingRequests,
FileTransferProgress progress,
long position)
Performs an optimized read of a file through use of asynchronous
messages.
|
void |
performOptimizedWrite(byte[] handle,
int blocksize,
int outstandingRequests,
InputStream in,
int buffersize,
FileTransferProgress progress)
Performs an optimized write of a file through asynchronous messaging and
through buffering the local file into memory.
|
void |
performOptimizedWrite(byte[] handle,
int blocksize,
int outstandingRequests,
InputStream in,
int buffersize,
FileTransferProgress progress,
long position)
Performs an optimized write of a file through asynchronous messaging and
through buffering the local file into memory.
|
void |
performSynchronousRead(byte[] handle,
int blocksize,
OutputStream out,
FileTransferProgress progress,
long position)
Perform a synchronous read of a file from the remote file system.
|
UnsignedInteger32 |
postReadRequest(byte[] handle,
long offset,
int len)
Post a read request to the server and return the request id; this is used
to optimize file downloads.
|
UnsignedInteger32 |
postWriteRequest(byte[] handle,
long position,
byte[] data,
int off,
int len)
Send a write request for an open file but do not wait for the response
from the server.
|
protected void |
processSupported(byte[] data) |
protected void |
processSupported2(byte[] data) |
int |
readFile(byte[] handle,
UnsignedInteger64 offset,
byte[] output,
int off,
int len)
Read a block of data from an open file.
|
void |
recurseMakeDirectory(String path)
Recurse through a hierarchy of directories creating them as necessary.
|
void |
removeDirectory(String path)
Remove an empty directory.
|
void |
removeFile(String filename)
Remove a file.
|
void |
renameFile(String oldpath,
String newpath)
Rename an existing file.
|
void |
renameFile(String oldpath,
String newpath,
int flags) |
UnsignedInteger32 |
sendExtensionMessage(String request,
byte[] requestData)
Send an extension message and return the response.
|
void |
setAttributes(SftpFile file,
SftpFileAttributes attrs)
Sets the attributes of a file.
|
void |
setAttributes(String path,
SftpFileAttributes attrs)
Sets the attributes of a file.
|
void |
setCharsetEncoding(String charset)
Allows the default character encoding to be overriden for filename
strings.
|
boolean |
supportsExtension(String name)
Does the server support an SFTP extension? This checks the extensions
returned by the server during the SFTP version negotiation.
|
void |
unlockFile(byte[] handle,
long offset,
long length) |
void |
writeFile(byte[] handle,
UnsignedInteger64 offset,
byte[] data,
int off,
int len)
Write a block of data to an open file.
|
createPacket, debug, debug, isClosed, nextMessage, sendMessageprotected static org.slf4j.Logger log
public static final int OPEN_READ
public static final int OPEN_WRITE
public static final int OPEN_APPEND
public static final int OPEN_CREATE
public static final int OPEN_TRUNCATE
public static final int OPEN_EXCLUSIVE
public static final int OPEN_TEXT
public static final int STATUS_FX_OK
public static final int STATUS_FX_EOF
public static final int SSH_FXP_INIT
public static final int SSH_FXP_VERSION
public static final int SSH_FXP_OPEN
public static final int SSH_FXP_CLOSE
public static final int SSH_FXP_READ
public static final int SSH_FXP_WRITE
public static final int SSH_FXP_LSTAT
public static final int SSH_FXP_FSTAT
public static final int SSH_FXP_SETSTAT
public static final int SSH_FXP_FSETSTAT
public static final int SSH_FXP_OPENDIR
public static final int SSH_FXP_READDIR
public static final int SSH_FXP_REMOVE
public static final int SSH_FXP_MKDIR
public static final int SSH_FXP_RMDIR
public static final int SSH_FXP_REALPATH
public static final int SSH_FXP_STAT
public static final int SSH_FXP_RENAME
public static final int SSH_FXP_READLINK
public static final int SSH_FXP_SYMLINK
public static final int SSH_FXP_LINK
public static final int SSH_FXP_BLOCK
public static final int SSH_FXP_UNBLOCK
public static final int SSH_FXP_STATUS
public static final int SSH_FXP_HANDLE
public static final int SSH_FXP_DATA
public static final int SSH_FXP_NAME
public static final int SSH_FXP_ATTRS
public static final int SSH_FXP_EXTENDED
public static final int SSH_FXP_EXTENDED_REPLY
public static final int MAX_VERSION
protected int version
public static final int SSH_FXF_ACCESS_DISPOSITION
public static final int SSH_FXF_CREATE_NEW
public static final int SSH_FXF_CREATE_TRUNCATE
public static final int SSH_FXF_OPEN_EXISTING
public static final int SSH_FXF_OPEN_OR_CREATE
public static final int SSH_FXF_TRUNCATE_EXISTING
public static final int SSH_FXF_ACCESS_APPEND_DATA
public static final int SSH_FXF_ACCESS_APPEND_DATA_ATOMIC
public static final int SSH_FXF_ACCESS_TEXT_MODE
public static final int SSH_FXF_ACCESS_BLOCK_READ
public static final int SSH_FXF_ACCESS_BLOCK_WRITE
public static final int SSH_FXF_ACCESS_BLOCK_DELETE
public static final int SSH_FXF_ACCESS_BLOCK_ADVISORY
public static final int SSH_FXF_NOFOLLOW
public static final int SSH_FXF_DELETE_ON_CLOSE
public static final int SSH_FXF_ACCESS_AUDIT_ALARM_INFO
public static final int SSH_FXF_ACCESS_BACKUP
public static final int SSH_FXF_BACKUP_STREAM
public static final int SSH_FXF_OVERRIDE_OWNER
public static final int SSH_FXP_RENAME_OVERWRITE
public static final int SSH_FXP_RENAME_ATOMIC
public static final int SSH_FXP_RENAME_NATIVE
public final boolean PROCESSING_PATHS
public SftpSubsystemChannel(SshSession session) throws SshException
SshExceptionpublic SftpSubsystemChannel(SshSession session, int maximumVersion) throws SshException
SshExceptionpublic SftpSubsystemChannel(SshSession session, int maximumVersion, int timeout) throws SshException
SshExceptionpublic int getVersion()
public void enableVerification()
public void disableVerification()
public TransportProtocol getTransport()
public byte[] getCanonicalNewline()
throws SftpStatusException
SftpStatusExceptionpublic void close()
throws IOException
SubsystemChannelclose in class SubsystemChannelIOExceptionpublic void initialize()
throws SshException,
UnsupportedEncodingException
protected void processSupported2(byte[] data)
throws IOException
IOExceptionprotected void processSupported(byte[] data)
throws IOException
IOExceptionpublic void setCharsetEncoding(String charset) throws SshException, UnsupportedEncodingException
charset - UnsupportedEncodingExceptionSshExceptionpublic int getServerVersion()
public String getCharsetEncoding()
public boolean supportsExtension(String name)
name - Stringpublic byte[] getExtension(String name)
supportsExtension(String) before calling this method to determine if the
extension is available.name - Stringpublic UnsignedInteger32 sendExtensionMessage(String request, byte[] requestData) throws SshException, SftpStatusException
request - StringrequestData - byte[]SshExceptionSftpStatusExceptionpublic void changePermissions(SftpFile file, int permissions) throws SftpStatusException, SshException
file - the filepermissions - an integer value containing a file permissions maskSshException - ,SftpStatusExceptionSftpStatusExceptionpublic void changePermissions(String filename, int permissions) throws SftpStatusException, SshException
filename - the path to the file.permissions - an integer value containing a file permissions mask.SshException - ,SftpStatusExceptionSftpStatusExceptionpublic void changePermissions(String filename, String permissions) throws SftpStatusException, SshException
filename - the path to the file.permissions - a string containing the permissions, for example "rw-r--r--"SftpStatusException - , SshExceptionSshExceptionpublic void setAttributes(String path, SftpFileAttributes attrs) throws SftpStatusException, SshException
path - the path to the file.attrs - the file attributes.SftpStatusException - , SshExceptionSshExceptionpublic void setAttributes(SftpFile file, SftpFileAttributes attrs) throws SftpStatusException, SshException
file - the file object.attrs - the new attributes.SshExceptionSftpStatusExceptionpublic UnsignedInteger32 postWriteRequest(byte[] handle, long position, byte[] data, int off, int len) throws SftpStatusException, SshException
handle - position - data - off - len - SshExceptionSftpStatusExceptionpublic void writeFile(byte[] handle,
UnsignedInteger64 offset,
byte[] data,
int off,
int len)
throws SftpStatusException,
SshException
handle - the open file handle.offset - the offset in the file to start writingdata - a buffer containing the data to writeoff - the offset to start in the bufferlen - the length of data to write (setting to false will increase
file transfer but may miss errors)SshExceptionSftpStatusExceptionpublic void performOptimizedWrite(byte[] handle,
int blocksize,
int outstandingRequests,
InputStream in,
int buffersize,
FileTransferProgress progress)
throws SftpStatusException,
SshException,
TransferCancelledException
handle - the open file handle to write toblocksize - the block size to send data, should be between 4096 and 65536outstandingRequests - the maximum number of requests that can be outstanding at any
one timein - the InputStream to read frombuffersize - the size of the temporary buffer to read from the InputStream.
Data is buffered into a temporary buffer so that the number of
local filesystem reads is reducted to a minimum. This
increases performance and so the buffer size should be as high
as possible. The default operation, if buffersize <= 0 is to
allocate a buffer the same size as the blocksize, meaning no
buffer optimization is performed.progress - provides progress information, may be null.SshExceptionSftpStatusExceptionTransferCancelledExceptionpublic void performOptimizedWrite(byte[] handle,
int blocksize,
int outstandingRequests,
InputStream in,
int buffersize,
FileTransferProgress progress,
long position)
throws SftpStatusException,
SshException,
TransferCancelledException
handle - the open file handle to write toblocksize - the block size to send data, should be between 4096 and 65536outstandingRequests - the maximum number of requests that can be outstanding at any
one timein - the InputStream to read frombuffersize - the size of the temporary buffer to read from the InputStream.
Data is buffered into a temporary buffer so that the number of
local filesystem reads is reducted to a minimum. This
increases performance and so the buffer size should be as high
as possible. The default operation, if buffersize <= 0 is to
allocate a buffer the same size as the blocksize, meaning no
buffer optimization is performed.progress - provides progress information, may be null.position - the position in the file to start writing to.SshExceptionSftpStatusExceptionTransferCancelledExceptionpublic void performOptimizedRead(byte[] handle,
long length,
int blocksize,
OutputStream out,
int outstandingRequests,
FileTransferProgress progress)
throws SftpStatusException,
SshException,
TransferCancelledException
handle - the open files handlelength - the length of the fileblocksize - the blocksize to readout - an OutputStream to output the file intooutstandingRequests - the maximum number of read requests toprogress - SshExceptionSftpStatusExceptionTransferCancelledExceptionpublic void performOptimizedRead(byte[] handle,
long length,
int blocksize,
OutputStream out,
int outstandingRequests,
FileTransferProgress progress,
long position)
throws SftpStatusException,
SshException,
TransferCancelledException
handle - the open files handlelength - the amount of the file file to be read, equal to the file
length when reading the whole fileblocksize - the blocksize to readout - an OutputStream to output the file intooutstandingRequests - the maximum number of read requests toprogress - position - the postition from which to start reading the fileSshExceptionSftpStatusExceptionTransferCancelledExceptionpublic void performSynchronousRead(byte[] handle,
int blocksize,
OutputStream out,
FileTransferProgress progress,
long position)
throws SftpStatusException,
SshException,
TransferCancelledException
handle - blocksize - out - progress - position - SftpStatusExceptionSshExceptionTransferCancelledExceptionpublic UnsignedInteger32 postReadRequest(byte[] handle, long offset, int len) throws SftpStatusException, SshException
handle - offset - len - SshExceptionSftpStatusExceptionpublic int readFile(byte[] handle,
UnsignedInteger64 offset,
byte[] output,
int off,
int len)
throws SftpStatusException,
SshException
handle - the open file handleoffset - the offset to start reading in the fileoutput - a buffer to write the returned data tooff - the starting offset in the output bufferlen - the length of data to readSshExceptionSftpStatusExceptionpublic SftpFile getFile(String path) throws SftpStatusException, SshException
SftpFile instance for a given path.path - SftpStatusExceptionSshExceptionpublic String getAbsolutePath(SftpFile file) throws SftpStatusException, SshException
file - SshExceptionSftpStatusExceptionpublic void lockFile(byte[] handle,
long offset,
long length,
int lockFlags)
throws SftpStatusException,
SshException
SftpStatusExceptionSshExceptionpublic void unlockFile(byte[] handle,
long offset,
long length)
throws SftpStatusException,
SshException
SftpStatusExceptionSshExceptionpublic void createSymbolicLink(String targetpath, String linkpath) throws SftpStatusException, SshException
targetpath - the symbolic link to createlinkpath - the path to which the symbolic link pointsSshException - if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.SftpStatusExceptionpublic void createLink(String targetpath, String linkpath, boolean symbolic) throws SftpStatusException, SshException
targetpath - the symbolic link to createlinkpath - the path to which the symbolic link pointsSshException - if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.SftpStatusExceptionpublic String getSymbolicLinkTarget(String linkpath) throws SftpStatusException, SshException
linkpath - SshException - if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.SftpStatusExceptionpublic String getDefaultDirectory() throws SftpStatusException, SshException
SshExceptionSftpStatusExceptionprotected static String getStatusDescription(ByteArrayReader msg) throws IOException
IOExceptionpublic String getAbsolutePath(String path) throws SftpStatusException, SshException
path - SshExceptionSftpStatusExceptionpublic int listChildren(SftpFile file, Vector<SftpFile> children) throws SftpStatusException, SshException
List the children of a directory.
To use this method first open a directory with the openDirectory method and then create a Vector to store the results. To retrieve the results keep calling this method until it returns -1 which indicates no more results will be returned.
SftpFile dir = sftp.openDirectory("code/foobar");
Vector results = new Vector();
while (sftp.listChildren(dir, results) > -1)
;
sftp.closeFile(dir);
file - children - SftpStatusException - , SshExceptionSshExceptionpublic int listChildren(SftpFile file, Vector<SftpFile> children, boolean disableAttributeCheck) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic void recurseMakeDirectory(String path) throws SftpStatusException, SshException
path - SftpStatusException - , SshExceptionSshExceptionpublic SftpFile openFile(String absolutePath, int flags) throws SftpStatusException, SshException
absolutePath - flags - SftpStatusException - , SshExceptionSshExceptionpublic SftpFile openFile(String absolutePath, int flags, SftpFileAttributes attrs) throws SftpStatusException, SshException
absolutePath - flags - attrs - SftpStatusException - , SshExceptionSshExceptionpublic SftpFile openFileVersion5(String absolutePath, int flags, int accessFlags, SftpFileAttributes attrs) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic SftpFile openDirectory(String path) throws SftpStatusException, SshException
path - SftpStatusException - , SshExceptionSshExceptionpublic SftpFile openDirectory(String path, boolean disableAttributeCheck) throws SftpStatusException, SshException
path - disableAttributeCheck - disable checks on the attributes returned.SftpStatusException - , SshExceptionSshExceptionprotected SftpFileAttributes getDefaultDirectoryPermissions()
public void closeFile(SftpFile file) throws SftpStatusException, SshException
file - SftpStatusException - , SshExceptionSshExceptionpublic void removeDirectory(String path) throws SftpStatusException, SshException
path - SftpStatusException - , SshExceptionSshExceptionpublic void removeFile(String filename) throws SftpStatusException, SshException
filename - SftpStatusException - , SshExceptionSshExceptionpublic void renameFile(String oldpath, String newpath) throws SftpStatusException, SshException
oldpath - newpath - SftpStatusException - , SshExceptionSshExceptionpublic void renameFile(String oldpath, String newpath, int flags) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic SftpFileAttributes getAttributes(String path) throws SftpStatusException, SshException
path - SshExceptionSftpStatusExceptionpublic SftpFileAttributes getLinkAttributes(String path) throws SftpStatusException, SshException
path - SftpStatusExceptionSshExceptionprotected SftpFileAttributes getAttributes(String path, int messageId, String messageName) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionprotected SftpFileAttributes extractAttributes(UnsignedInteger32 requestId, SftpMessage bar) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic SftpFileAttributes getAttributes(SftpFile file) throws SftpStatusException, SshException
file - SftpStatusException - , SshExceptionSshExceptionpublic void makeDirectory(String path) throws SftpStatusException, SshException
path - SftpStatusException - , SshExceptionSshExceptionpublic void makeDirectory(String path, SftpFileAttributes attrs) throws SftpStatusException, SshException
path - attrs - SftpStatusException - , SshExceptionSshExceptionpublic byte[] getHandleResponse(UnsignedInteger32 requestId) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic byte[] getHandleResponse(SftpMessage bar, UnsignedInteger32 requestId) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic SftpMessage getExtensionResponse(UnsignedInteger32 requestId) throws SftpStatusException, SshException
SftpStatusExceptionSshExceptionpublic void getOKRequestStatus(UnsignedInteger32 requestId) throws SftpStatusException, SshException
requestId - SftpStatusException - , SshExceptionSshExceptionpublic SftpMessage getResponse(UnsignedInteger32 requestId) throws SshException
SshExceptionpublic SftpFile getSingleFileResponse(SftpMessage bar, String messageName) throws SshException, SftpStatusException
bar - messageName - SshExceptionSftpStatusExceptionpublic int getMaximumRemotePacketLength()
public int getMaximumLocalPacketLength()
public long getMaximumLocalWindowSize()
public long getMaximumRemoteWindowSize()
Copyright © 2025. All rights reserved.