public class SftpChannel extends AbstractSubsystem
Modifier and Type | Field and Description |
---|---|
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.
|
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_DATA |
static int |
SSH_FXP_EXTENDED |
static int |
SSH_FXP_EXTENDED_REPLY |
static int |
SSH_FXP_HANDLE |
static int |
SSH_FXP_NAME |
static int |
SSH_FXP_RENAME_ATOMIC |
static int |
SSH_FXP_RENAME_NATIVE |
static int |
SSH_FXP_RENAME_OVERWRITE |
static int |
SSH_FXP_STATUS |
con, session, timeout
Constructor and Description |
---|
SftpChannel(com.sshtools.common.ssh.SshConnection con) |
Modifier and Type | Method and Description |
---|---|
void |
changePermissions(SftpFile file,
int permissions)
Change the permissions of a file.
|
void |
changePermissions(java.lang.String filename,
int permissions)
Change the permissions of a file.
|
void |
changePermissions(java.lang.String filename,
java.lang.String permissions)
Change the permissions of a file.
|
void |
close() |
void |
closeFile(SftpFile file)
Close a file or directory.
|
void |
createLink(java.lang.String targetpath,
java.lang.String linkpath,
boolean symbolic)
Create a symbolic link.
|
protected com.sshtools.common.ssh.Packet |
createPacket()
Get a packet from the available pool or create if non available
|
void |
createSymbolicLink(java.lang.String targetpath,
java.lang.String linkpath)
Create a symbolic link.
|
java.lang.String |
getAbsolutePath(SftpFile file)
Get the absolute path of a file.
|
java.lang.String |
getAbsolutePath(java.lang.String path)
Get the absolute path of a file.
|
com.sshtools.common.sftp.SftpFileAttributes |
getAttributes(SftpFile file)
Get the attributes of a file.
|
com.sshtools.common.sftp.SftpFileAttributes |
getAttributes(java.lang.String path)
Get the attributes of a file.
|
protected com.sshtools.common.sftp.SftpFileAttributes |
getAttributes(java.lang.String path,
int messageId) |
byte[] |
getCanonicalNewline()
Returns the canonical newline convention in use when reading/writing text
files.
|
java.lang.String |
getCharsetEncoding()
Get the current encoding being used for filename Strings.
|
SshClientContext |
getContext() |
java.lang.String |
getDefaultDirectory()
Gets the users default directory.
|
byte[] |
getExtension(java.lang.String name)
Get the data value of a supported SFTP extension.
|
java.util.Map<java.lang.String,byte[]> |
getExtensions() |
SftpFile |
getFile(java.lang.String path)
Utility method to obtain an
SftpFile instance for a given path. |
byte[] |
getHandleResponse(SftpMessage bar) |
byte[] |
getHandleResponse(com.sshtools.common.util.UnsignedInteger32 requestId) |
com.sshtools.common.sftp.SftpFileAttributes |
getLinkAttributes(java.lang.String path)
Get the attributes of a file.
|
int |
getMaximumLocalPacketLength() |
int |
getMaximumLocalWindowSize() |
protected int |
getMaximumPacketSize() |
int |
getMaximumRemotePacketLength() |
int |
getMaximumRemoteWindowSize() |
protected int |
getMaximumWindowSize() |
protected int |
getMinimumWindowSize() |
void |
getOKRequestStatus(com.sshtools.common.util.UnsignedInteger32 requestId)
Verify that an OK status has been returned for a request id.
|
SftpMessage |
getResponse(com.sshtools.common.util.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,
java.lang.String messageName)
Get a single SftpFile object from a message returning SSH_FXP_NAME result.
|
java.lang.String |
getSymbolicLinkTarget(java.lang.String linkpath)
Get the target path of a symbolic link.
|
int |
getVersion() |
boolean |
isClosed() |
int |
listChildren(SftpFile file,
java.util.List<SftpFile> children)
List the children of a directory.
|
void |
lockFile(byte[] handle,
long offset,
long length,
int lockFlags) |
void |
makeDirectory(java.lang.String path)
Make a directory.
|
void |
makeDirectory(java.lang.String path,
com.sshtools.common.sftp.SftpFileAttributes attrs)
Make a directory.
|
SftpFile |
openDirectory(java.lang.String path)
Open a directory.
|
SftpFile |
openFile(java.lang.String absolutePath,
int flags)
Open a file.
|
SftpFile |
openFile(java.lang.String absolutePath,
int flags,
com.sshtools.common.sftp.SftpFileAttributes attrs)
Open a file.
|
SftpFile |
openFileVersion5(java.lang.String absolutePath,
int flags,
int accessFlags,
com.sshtools.common.sftp.SftpFileAttributes attrs) |
void |
performOptimizedRead(java.lang.String filename,
byte[] handle,
long length,
int blocksize,
java.io.OutputStream out,
int outstandingRequests,
FileTransferProgress progress)
Performs an optimized read of a file through use of asynchronous
messages.
|
void |
performOptimizedRead(java.lang.String filename,
byte[] handle,
long length,
int blocksize,
java.io.OutputStream out,
int outstandingRequests,
FileTransferProgress progress,
long position)
Performs an optimized read of a file through use of asynchronous
messages.
|
void |
performOptimizedWrite(java.lang.String filename,
byte[] handle,
int blocksize,
int outstandingRequests,
java.io.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(java.lang.String filename,
byte[] handle,
int blocksize,
int outstandingRequests,
java.io.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,
java.io.OutputStream out,
FileTransferProgress progress,
long position)
Perform a synchronous read of a file from the remote file system.
|
com.sshtools.common.util.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.
|
com.sshtools.common.util.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,
com.sshtools.common.util.UnsignedInteger64 offset,
byte[] output,
int off,
int len)
Read a block of data from an open file.
|
void |
recurseMakeDirectory(java.lang.String path)
Recurse through a hierarchy of directories creating them as necessary.
|
void |
removeDirectory(java.lang.String path)
Remove an empty directory.
|
void |
removeFile(java.lang.String filename)
Remove a file.
|
void |
renameFile(java.lang.String oldpath,
java.lang.String newpath)
Rename an existing file.
|
void |
renameFile(java.lang.String oldpath,
java.lang.String newpath,
int flags) |
com.sshtools.common.util.UnsignedInteger32 |
sendExtensionMessage(java.lang.String request,
byte[] requestData)
Send an extension message and return the response.
|
void |
setAttributes(SftpFile file,
com.sshtools.common.sftp.SftpFileAttributes attrs)
Sets the attributes of a file.
|
void |
setAttributes(java.lang.String path,
com.sshtools.common.sftp.SftpFileAttributes attrs)
Sets the attributes of a file.
|
void |
setCharsetEncoding(java.lang.String charset)
Allows the default character encoding to be overriden for filename
strings.
|
boolean |
supportsExtension(java.lang.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,
com.sshtools.common.util.UnsignedInteger64 offset,
byte[] data,
int off,
int len)
Write a block of data to an open file.
|
getSession, nextMessage, onCloseSession, sendMessage
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 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
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 SftpChannel(com.sshtools.common.ssh.SshConnection con) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public int getVersion()
protected int getMinimumWindowSize()
getMinimumWindowSize
in class AbstractSubsystem
protected int getMaximumWindowSize()
getMaximumWindowSize
in class AbstractSubsystem
protected int getMaximumPacketSize()
getMaximumPacketSize
in class AbstractSubsystem
public java.util.Map<java.lang.String,byte[]> getExtensions()
public byte[] getCanonicalNewline() throws com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.sftp.SftpStatusException
protected void processSupported2(byte[] data) throws java.io.IOException
java.io.IOException
protected void processSupported(byte[] data) throws java.io.IOException
java.io.IOException
public void setCharsetEncoding(java.lang.String charset) throws com.sshtools.common.ssh.SshException, java.io.UnsupportedEncodingException
charset
- java.io.UnsupportedEncodingException
com.sshtools.common.ssh.SshException
public int getServerVersion()
public java.lang.String getCharsetEncoding()
public boolean supportsExtension(java.lang.String name)
name
- Stringpublic byte[] getExtension(java.lang.String name)
supportsExtension(String)
before calling this method to determine if the
extension is available.name
- Stringpublic void close()
public SftpMessage getResponse(com.sshtools.common.util.UnsignedInteger32 requestId) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public void changePermissions(SftpFile file, int permissions) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
file
- the filepermissions
- an integer value containing a file permissions maskcom.sshtools.common.ssh.SshException
- ,SftpStatusExceptioncom.sshtools.common.sftp.SftpStatusException
public void changePermissions(java.lang.String filename, int permissions) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
filename
- the path to the file.permissions
- an integer value containing a file permissions mask.com.sshtools.common.ssh.SshException
- ,SftpStatusExceptioncom.sshtools.common.sftp.SftpStatusException
public void changePermissions(java.lang.String filename, java.lang.String permissions) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
filename
- the path to the file.permissions
- a string containing the permissions, for example "rw-r--r--"com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void getOKRequestStatus(com.sshtools.common.util.UnsignedInteger32 requestId) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
requestId
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void setAttributes(java.lang.String path, com.sshtools.common.sftp.SftpFileAttributes attrs) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- the path to the file.attrs
- the file attributes.com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void setAttributes(SftpFile file, com.sshtools.common.sftp.SftpFileAttributes attrs) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
file
- the file object.attrs
- the new attributes.com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public com.sshtools.common.util.UnsignedInteger32 postWriteRequest(byte[] handle, long position, byte[] data, int off, int len) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
handle
- position
- data
- off
- len
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public void writeFile(byte[] handle, com.sshtools.common.util.UnsignedInteger64 offset, byte[] data, int off, int len) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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)com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public void performOptimizedWrite(java.lang.String filename, byte[] handle, int blocksize, int outstandingRequests, java.io.InputStream in, int buffersize, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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.com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
TransferCancelledException
public void performOptimizedWrite(java.lang.String filename, byte[] handle, int blocksize, int outstandingRequests, java.io.InputStream in, int buffersize, FileTransferProgress progress, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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.com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
TransferCancelledException
public void performOptimizedRead(java.lang.String filename, byte[] handle, long length, int blocksize, java.io.OutputStream out, int outstandingRequests, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
TransferCancelledException
public void performOptimizedRead(java.lang.String filename, byte[] handle, long length, int blocksize, java.io.OutputStream out, int outstandingRequests, FileTransferProgress progress, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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 filecom.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
TransferCancelledException
public void performSynchronousRead(byte[] handle, int blocksize, java.io.OutputStream out, FileTransferProgress progress, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
handle
- blocksize
- out
- progress
- position
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public com.sshtools.common.util.UnsignedInteger32 postReadRequest(byte[] handle, long offset, int len) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
handle
- offset
- len
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public int readFile(byte[] handle, com.sshtools.common.util.UnsignedInteger64 offset, byte[] output, int off, int len) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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 readcom.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public SftpFile getFile(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
SftpFile
instance for a given path.path
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public java.lang.String getAbsolutePath(SftpFile file) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
file
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public void lockFile(byte[] handle, long offset, long length, int lockFlags) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void unlockFile(byte[] handle, long offset, long length) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void createSymbolicLink(java.lang.String targetpath, java.lang.String linkpath) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
targetpath
- the symbolic link to createlinkpath
- the path to which the symbolic link pointscom.sshtools.common.ssh.SshException
- if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.com.sshtools.common.sftp.SftpStatusException
public void createLink(java.lang.String targetpath, java.lang.String linkpath, boolean symbolic) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
targetpath
- the symbolic link to createlinkpath
- the path to which the symbolic link pointscom.sshtools.common.ssh.SshException
- if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.com.sshtools.common.sftp.SftpStatusException
public java.lang.String getSymbolicLinkTarget(java.lang.String linkpath) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
linkpath
- com.sshtools.common.ssh.SshException
- if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.com.sshtools.common.sftp.SftpStatusException
public java.lang.String getDefaultDirectory() throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public java.lang.String getAbsolutePath(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public SftpFile getSingleFileResponse(SftpMessage bar, java.lang.String messageName) throws com.sshtools.common.ssh.SshException, com.sshtools.common.sftp.SftpStatusException
bar
- messageName
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public int listChildren(SftpFile file, java.util.List<SftpFile> children) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.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
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void recurseMakeDirectory(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public SftpFile openFile(java.lang.String absolutePath, int flags) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
absolutePath
- flags
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public SftpFile openFile(java.lang.String absolutePath, int flags, com.sshtools.common.sftp.SftpFileAttributes attrs) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
absolutePath
- flags
- attrs
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public SftpFile openFileVersion5(java.lang.String absolutePath, int flags, int accessFlags, com.sshtools.common.sftp.SftpFileAttributes attrs) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public SftpFile openDirectory(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void closeFile(SftpFile file) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
file
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void removeDirectory(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void removeFile(java.lang.String filename) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
filename
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void renameFile(java.lang.String oldpath, java.lang.String newpath) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
oldpath
- newpath
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void renameFile(java.lang.String oldpath, java.lang.String newpath, int flags) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.sftp.SftpFileAttributes getAttributes(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public com.sshtools.common.sftp.SftpFileAttributes getLinkAttributes(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
protected com.sshtools.common.sftp.SftpFileAttributes getAttributes(java.lang.String path, int messageId) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.sftp.SftpFileAttributes getAttributes(SftpFile file) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
file
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void makeDirectory(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public void makeDirectory(java.lang.String path, com.sshtools.common.sftp.SftpFileAttributes attrs) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- attrs
- com.sshtools.common.sftp.SftpStatusException
- , SshExceptioncom.sshtools.common.ssh.SshException
public byte[] getHandleResponse(com.sshtools.common.util.UnsignedInteger32 requestId) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public byte[] getHandleResponse(SftpMessage bar) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.util.UnsignedInteger32 sendExtensionMessage(java.lang.String request, byte[] requestData) throws com.sshtools.common.ssh.SshException, com.sshtools.common.sftp.SftpStatusException
request
- StringrequestData
- byte[]com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
protected com.sshtools.common.ssh.Packet createPacket() throws java.io.IOException
java.io.IOException
public boolean isClosed()
public int getMaximumLocalWindowSize()
public int getMaximumLocalPacketLength()
public int getMaximumRemoteWindowSize()
public int getMaximumRemotePacketLength()
public SshClientContext getContext()
Copyright © 2022. All rights reserved.