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 intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.sshtools.j2ssh.connection.Channel
connection, localChannelId, localPacketSize, localWindow, remoteChannelId, remotePacketSize, remoteWindow, state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longvoidchangePermissions(SftpFile file, int permissions) voidchangePermissions(SftpFile file, String permissions) voidchangePermissions(String filename, int permissions) voidchangePermissions(String filename, String permissions) voidprotected voidcloseHandle(byte[] handle) voidcreateSymbolicLink(String targetpath, String linkpath) getAbsolutePath(SftpFile file) getAbsolutePath(String path) getAttributes(SftpFile file) getAttributes(String path) protected intprotected intprotected intgetName()getSymbolicLinkTarget(String linkpath) booleanprotected booleanisValidHandle(byte[] handle) intlistChildren(SftpFile file, List children) voidmakeDirectory(String path) protected longopenDirectory(String path) openFile(String absolutePath, int flags, FileAttributes attrs) protected intreadFile(byte[] handle, UnsignedInteger64 offset, byte[] output, int off, int len) voidrecurseMakeDirectory(String path) voidremoveDirectory(String path) voidremoveFile(String filename) voidrenameFile(String oldpath, String newpath) voidsetAttributes(SftpFile file, FileAttributes attrs) voidsetAttributes(String path, FileAttributes attrs) protected voidwriteFile(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, startSubsystemMethods 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:
getMinimumWindowSpacein classChannel- Returns:
-
getMaximumWindowSpace
protected int getMaximumWindowSpace()- Specified by:
getMaximumWindowSpacein classChannel- Returns:
-
getMaximumPacketSize
protected int getMaximumPacketSize()- Specified by:
getMaximumPacketSizein classChannel- Returns:
-