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
-
public class SftpSubsystemClient extends SubsystemChannel
- Version:
- $Revision: 1.38 $
- Author:
- $author$
-
-
Field Summary
Fields Modifier and Type Field Description static intOPEN_APPENDstatic intOPEN_CREATEstatic intOPEN_EXCLUSIVEstatic intOPEN_READstatic intOPEN_TRUNCATEstatic intOPEN_WRITEstatic intVERSION_1static intVERSION_2static intVERSION_3static intVERSION_4-
Fields inherited from class com.sshtools.j2ssh.connection.Channel
connection, localChannelId, localPacketSize, localWindow, remoteChannelId, remotePacketSize, remoteWindow, state
-
-
Constructor Summary
Constructors Constructor Description SftpSubsystemClient()Creates a new SftpSubsystemClient object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longavailableWindowSpace()voidchangePermissions(SftpFile file, int permissions)voidchangePermissions(SftpFile file, java.lang.String permissions)voidchangePermissions(java.lang.String filename, int permissions)voidchangePermissions(java.lang.String filename, java.lang.String permissions)voidcloseFile(SftpFile file)protected voidcloseHandle(byte[] handle)voidcreateSymbolicLink(java.lang.String targetpath, java.lang.String linkpath)java.lang.StringgetAbsolutePath(SftpFile file)java.lang.StringgetAbsolutePath(java.lang.String path)FileAttributesgetAttributes(SftpFile file)FileAttributesgetAttributes(java.lang.String path)java.lang.StringgetDefaultDirectory()protected intgetMaximumPacketSize()protected intgetMaximumWindowSpace()protected intgetMinimumWindowSpace()java.lang.StringgetName()java.lang.StringgetSymbolicLinkTarget(java.lang.String linkpath)booleaninitialize()protected booleanisValidHandle(byte[] handle)intlistChildren(SftpFile file, java.util.List children)voidmakeDirectory(java.lang.String path)protected longmaximumPacketSize()SftpFileopenDirectory(java.lang.String path)SftpFileopenFile(java.lang.String filename, int flags)SftpFileopenFile(java.lang.String absolutePath, int flags, FileAttributes attrs)protected intreadFile(byte[] handle, UnsignedInteger64 offset, byte[] output, int off, int len)voidrecurseMakeDirectory(java.lang.String path)voidremoveDirectory(java.lang.String path)voidremoveFile(java.lang.String filename)voidrenameFile(java.lang.String oldpath, java.lang.String newpath)voidsetAttributes(SftpFile file, FileAttributes attrs)voidsetAttributes(java.lang.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, 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 Detail
-
OPEN_READ
public static final int OPEN_READ
- See Also:
- Constant Field Values
-
OPEN_WRITE
public static final int OPEN_WRITE
- See Also:
- Constant Field Values
-
OPEN_APPEND
public static final int OPEN_APPEND
- See Also:
- Constant Field Values
-
OPEN_CREATE
public static final int OPEN_CREATE
- See Also:
- Constant Field Values
-
OPEN_TRUNCATE
public static final int OPEN_TRUNCATE
- See Also:
- Constant Field Values
-
OPEN_EXCLUSIVE
public static final int OPEN_EXCLUSIVE
- See Also:
- Constant Field Values
-
VERSION_1
public static final int VERSION_1
- See Also:
- Constant Field Values
-
VERSION_2
public static final int VERSION_2
- See Also:
- Constant Field Values
-
VERSION_3
public static final int VERSION_3
- See Also:
- Constant Field Values
-
VERSION_4
public static final int VERSION_4
- See Also:
- Constant Field Values
-
-
Method Detail
-
availableWindowSpace
protected long availableWindowSpace()
- Returns:
-
maximumPacketSize
protected long maximumPacketSize()
- Returns:
-
closeHandle
protected void closeHandle(byte[] handle) throws java.io.IOException- Parameters:
handle-- Throws:
java.io.IOException
-
closeFile
public void closeFile(SftpFile file) throws java.io.IOException
- Parameters:
file-- Throws:
java.io.IOException
-
isValidHandle
protected boolean isValidHandle(byte[] handle)
- Parameters:
handle-- Returns:
-
listChildren
public int listChildren(SftpFile file, java.util.List children) throws java.io.IOException
- Parameters:
file-children-- Returns:
- Throws:
java.io.IOException
-
makeDirectory
public void makeDirectory(java.lang.String path) throws java.io.IOException- Parameters:
path-- Throws:
java.io.IOException
-
recurseMakeDirectory
public void recurseMakeDirectory(java.lang.String path) throws java.io.IOException- Parameters:
path-- Throws:
java.io.IOException
-
openDirectory
public SftpFile openDirectory(java.lang.String path) throws java.io.IOException
- Parameters:
path-- Returns:
- Throws:
java.io.IOException
-
getDefaultDirectory
public java.lang.String getDefaultDirectory() throws java.io.IOException- Returns:
- Throws:
java.io.IOException
-
getAbsolutePath
public java.lang.String getAbsolutePath(java.lang.String path) throws java.io.IOException- Parameters:
path-- Returns:
- Throws:
java.io.IOException
-
getAbsolutePath
public java.lang.String getAbsolutePath(SftpFile file) throws java.io.IOException
- Parameters:
file-- Returns:
- Throws:
java.io.IOException
-
openFile
public SftpFile openFile(java.lang.String filename, int flags) throws java.io.IOException
- Parameters:
filename-flags-- Returns:
- Throws:
java.io.IOException
-
openFile
public SftpFile openFile(java.lang.String absolutePath, int flags, FileAttributes attrs) throws java.io.IOException
- Parameters:
absolutePath-flags-attrs-- Returns:
- Throws:
java.io.IOException
-
getAttributes
public FileAttributes getAttributes(java.lang.String path) throws java.io.IOException
- Parameters:
path-- Returns:
- Throws:
java.io.IOException
-
getAttributes
public FileAttributes getAttributes(SftpFile file) throws java.io.IOException
- Parameters:
file-- Returns:
- Throws:
java.io.IOException
-
readFile
protected int readFile(byte[] handle, UnsignedInteger64 offset, byte[] output, int off, int len) throws java.io.IOException- Parameters:
handle-offset-output-off-len-- Returns:
- Throws:
java.io.IOException
-
removeDirectory
public void removeDirectory(java.lang.String path) throws java.io.IOException- Parameters:
path-- Throws:
java.io.IOException
-
removeFile
public void removeFile(java.lang.String filename) throws java.io.IOException- Parameters:
filename-- Throws:
java.io.IOException
-
renameFile
public void renameFile(java.lang.String oldpath, java.lang.String newpath) throws java.io.IOException- Parameters:
oldpath-newpath-- Throws:
java.io.IOException
-
writeFile
protected void writeFile(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) throws java.io.IOException- Parameters:
handle-offset-data-off-len-- Throws:
java.io.IOException
-
createSymbolicLink
public void createSymbolicLink(java.lang.String targetpath, java.lang.String linkpath) throws java.io.IOException- Parameters:
targetpath-linkpath-- Throws:
java.io.IOException
-
getSymbolicLinkTarget
public java.lang.String getSymbolicLinkTarget(java.lang.String linkpath) throws java.io.IOException- Parameters:
linkpath-- Returns:
- Throws:
java.io.IOException
-
setAttributes
public void setAttributes(java.lang.String path, FileAttributes attrs) throws java.io.IOException- Parameters:
path-attrs-- Throws:
java.io.IOException
-
setAttributes
public void setAttributes(SftpFile file, FileAttributes attrs) throws java.io.IOException
- Parameters:
file-attrs-- Throws:
java.io.IOException
-
changePermissions
public void changePermissions(SftpFile file, java.lang.String permissions) throws java.io.IOException
- Parameters:
file-permissions-- Throws:
java.io.IOException
-
changePermissions
public void changePermissions(SftpFile file, int permissions) throws java.io.IOException
- Parameters:
file-permissions-- Throws:
java.io.IOException
-
changePermissions
public void changePermissions(java.lang.String filename, int permissions) throws java.io.IOException- Parameters:
filename-permissions-- Throws:
java.io.IOException
-
changePermissions
public void changePermissions(java.lang.String filename, java.lang.String permissions) throws java.io.IOException- Parameters:
filename-permissions-- Throws:
java.io.IOException
-
initialize
public boolean initialize() throws java.io.IOException- Returns:
- Throws:
java.io.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:
-
-