Package com.sshtools.j2ssh.sftp
Class SftpSubsystemClient
java.lang.Object
com.sshtools.j2ssh.connection.Channel
com.sshtools.j2ssh.subsystem.SubsystemChannel
com.sshtools.j2ssh.sftp.SftpSubsystemClient
- Version:
- $Revision: 1.38 $
- Author:
- $author$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class com.sshtools.j2ssh.connection.Channel
connection, localChannelId, localPacketSize, localWindow, remoteChannelId, remotePacketSize, remoteWindow, state
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected long
void
changePermissions
(SftpFile file, int permissions) void
changePermissions
(SftpFile file, String permissions) void
changePermissions
(String filename, int permissions) void
changePermissions
(String filename, String permissions) void
protected void
closeHandle
(byte[] handle) void
createSymbolicLink
(String targetpath, String linkpath) getAbsolutePath
(SftpFile file) getAbsolutePath
(String path) getAttributes
(SftpFile file) getAttributes
(String path) protected int
protected int
protected int
getName()
getSymbolicLinkTarget
(String linkpath) boolean
protected boolean
isValidHandle
(byte[] handle) int
listChildren
(SftpFile file, List children) void
makeDirectory
(String path) protected long
openDirectory
(String path) openFile
(String absolutePath, int flags, FileAttributes attrs) protected int
readFile
(byte[] handle, UnsignedInteger64 offset, byte[] output, int off, int len) void
recurseMakeDirectory
(String path) void
removeDirectory
(String path) void
removeFile
(String filename) void
renameFile
(String oldpath, String newpath) void
setAttributes
(SftpFile file, FileAttributes attrs) void
setAttributes
(String path, FileAttributes attrs) protected void
writeFile
(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) Methods inherited from class com.sshtools.j2ssh.subsystem.SubsystemChannel
getChannelConfirmationData, getChannelOpenData, getChannelType, onChannelClose, onChannelData, onChannelEOF, onChannelExtData, onChannelOpen, onChannelRequest, sendMessage, startSubsystem
Methods inherited from class com.sshtools.j2ssh.connection.Channel
addEventListener, close, finalizeClose, getLocalChannelId, getLocalPacketSize, getLocalWindow, getRemoteChannelId, getRemotePacketSize, getRemoteWindow, getState, init, init, isClosed, isLocalEOF, isOpen, isRemoteEOF, open, processChannelData, processChannelData, remoteClose, sendChannelData, sendChannelExtData, setLocalEOF, setName, setRemoteEOF
-
Field Details
-
OPEN_READ
public static final int OPEN_READ- See Also:
-
OPEN_WRITE
public static final int OPEN_WRITE- See Also:
-
OPEN_APPEND
public static final int OPEN_APPEND- See Also:
-
OPEN_CREATE
public static final int OPEN_CREATE- See Also:
-
OPEN_TRUNCATE
public static final int OPEN_TRUNCATE- See Also:
-
OPEN_EXCLUSIVE
public static final int OPEN_EXCLUSIVE- See Also:
-
VERSION_1
public static final int VERSION_1- See Also:
-
VERSION_2
public static final int VERSION_2- See Also:
-
VERSION_3
public static final int VERSION_3- See Also:
-
VERSION_4
public static final int VERSION_4- See Also:
-
-
Constructor Details
-
SftpSubsystemClient
public SftpSubsystemClient()Creates a new SftpSubsystemClient object.
-
-
Method Details
-
getName
-
availableWindowSpace
protected long availableWindowSpace()- Returns:
-
maximumPacketSize
protected long maximumPacketSize()- Returns:
-
closeHandle
- Parameters:
handle
-- Throws:
IOException
-
closeFile
- Parameters:
file
-- Throws:
IOException
-
isValidHandle
protected boolean isValidHandle(byte[] handle) - Parameters:
handle
-- Returns:
-
listChildren
- Parameters:
file
-children
-- Returns:
- Throws:
IOException
-
makeDirectory
- Parameters:
path
-- Throws:
IOException
-
recurseMakeDirectory
- Parameters:
path
-- Throws:
IOException
-
openDirectory
- Parameters:
path
-- Returns:
- Throws:
IOException
-
getDefaultDirectory
- Returns:
- Throws:
IOException
-
getAbsolutePath
- Parameters:
path
-- Returns:
- Throws:
IOException
-
getAbsolutePath
- Parameters:
file
-- Returns:
- Throws:
IOException
-
openFile
- Parameters:
filename
-flags
-- Returns:
- Throws:
IOException
-
openFile
- Parameters:
absolutePath
-flags
-attrs
-- Returns:
- Throws:
IOException
-
getAttributes
- Parameters:
path
-- Returns:
- Throws:
IOException
-
getAttributes
- Parameters:
file
-- Returns:
- Throws:
IOException
-
readFile
protected int readFile(byte[] handle, UnsignedInteger64 offset, byte[] output, int off, int len) throws IOException - Parameters:
handle
-offset
-output
-off
-len
-- Returns:
- Throws:
IOException
-
removeDirectory
- Parameters:
path
-- Throws:
IOException
-
removeFile
- Parameters:
filename
-- Throws:
IOException
-
renameFile
- Parameters:
oldpath
-newpath
-- Throws:
IOException
-
writeFile
protected void writeFile(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) throws IOException - Parameters:
handle
-offset
-data
-off
-len
-- Throws:
IOException
-
createSymbolicLink
- Parameters:
targetpath
-linkpath
-- Throws:
IOException
-
getSymbolicLinkTarget
- Parameters:
linkpath
-- Returns:
- Throws:
IOException
-
setAttributes
- Parameters:
path
-attrs
-- Throws:
IOException
-
setAttributes
- Parameters:
file
-attrs
-- Throws:
IOException
-
changePermissions
- Parameters:
file
-permissions
-- Throws:
IOException
-
changePermissions
- Parameters:
file
-permissions
-- Throws:
IOException
-
changePermissions
- Parameters:
filename
-permissions
-- Throws:
IOException
-
changePermissions
- Parameters:
filename
-permissions
-- Throws:
IOException
-
initialize
- Returns:
- Throws:
IOException
-
getMinimumWindowSpace
protected int getMinimumWindowSpace()- Specified by:
getMinimumWindowSpace
in classChannel
- Returns:
-
getMaximumWindowSpace
protected int getMaximumWindowSpace()- Specified by:
getMaximumWindowSpace
in classChannel
- Returns:
-
getMaximumPacketSize
protected int getMaximumPacketSize()- Specified by:
getMaximumPacketSize
in classChannel
- Returns:
-