com.sshtools.j2ssh.sftp

Class SftpSubsystemClient


public class SftpSubsystemClient
extends SubsystemChannel

Version:
$Revision: 1.38 $
Author:
$author$

Field Summary

static int
OPEN_APPEND
static int
OPEN_CREATE
static int
OPEN_EXCLUSIVE
static int
OPEN_READ
static int
OPEN_TRUNCATE
static int
OPEN_WRITE
static int
VERSION_1
static int
VERSION_2
static int
VERSION_3
static int
VERSION_4

Fields inherited from class com.sshtools.j2ssh.subsystem.SubsystemChannel

messageStore

Fields inherited from class com.sshtools.j2ssh.connection.Channel

connection, localChannelId, localPacketSize, localWindow, remoteChannelId, remotePacketSize, remoteWindow, state

Constructor Summary

SftpSubsystemClient()
Creates a new SftpSubsystemClient object.

Method Summary

protected long
availableWindowSpace()
void
changePermissions(String filename, String permissions)
void
changePermissions(String filename, int permissions)
void
changePermissions(SftpFile file, String permissions)
void
changePermissions(SftpFile file, int permissions)
void
closeFile(SftpFile file)
protected void
closeHandle(byte[] handle)
void
createSymbolicLink(String targetpath, String linkpath)
String
getAbsolutePath(String path)
String
getAbsolutePath(SftpFile file)
FileAttributes
getAttributes(String path)
FileAttributes
getAttributes(SftpFile file)
String
getDefaultDirectory()
protected int
getMaximumPacketSize()
protected int
getMaximumWindowSpace()
protected int
getMinimumWindowSpace()
String
getName()
String
getSymbolicLinkTarget(String linkpath)
boolean
initialize()
protected boolean
isValidHandle(byte[] handle)
int
listChildren(SftpFile file, List children)
void
makeDirectory(String path)
protected long
maximumPacketSize()
SftpFile
openDirectory(String path)
SftpFile
openFile(String filename, int flags)
SftpFile
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(String path, FileAttributes attrs)
void
setAttributes(SftpFile file, 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, getChannelConfirmationData, getChannelOpenData, getChannelType, getLocalChannelId, getLocalPacketSize, getLocalWindow, getMaximumPacketSize, getMaximumWindowSpace, getMinimumWindowSpace, getName, getRemoteChannelId, getRemotePacketSize, getRemoteWindow, getState, init, init, isClosed, isLocalEOF, isOpen, isRemoteEOF, onChannelClose, onChannelData, onChannelEOF, onChannelExtData, onChannelOpen, onChannelRequest, open, processChannelData, processChannelData, remoteClose, sendChannelData, sendChannelExtData, setLocalEOF, setName, setRemoteEOF

Field Details

OPEN_APPEND

public static final int OPEN_APPEND
Field Value:
4

OPEN_CREATE

public static final int OPEN_CREATE
Field Value:
8

OPEN_EXCLUSIVE

public static final int OPEN_EXCLUSIVE
Field Value:
32

OPEN_READ

public static final int OPEN_READ
Field Value:
1

OPEN_TRUNCATE

public static final int OPEN_TRUNCATE
Field Value:
16

OPEN_WRITE

public static final int OPEN_WRITE
Field Value:
2

VERSION_1

public static final int VERSION_1
Field Value:
1

VERSION_2

public static final int VERSION_2
Field Value:
2

VERSION_3

public static final int VERSION_3
Field Value:
3

VERSION_4

public static final int VERSION_4
Field Value:
4

Constructor Details

SftpSubsystemClient

public SftpSubsystemClient()
Creates a new SftpSubsystemClient object.

Method Details

availableWindowSpace

protected long availableWindowSpace()
Returns:

changePermissions

public void changePermissions(String filename,
                              String permissions)
            throws IOException
Parameters:
filename -
permissions -

changePermissions

public void changePermissions(String filename,
                              int permissions)
            throws IOException
Parameters:
filename -
permissions -

changePermissions

public void changePermissions(SftpFile file,
                              String permissions)
            throws IOException
Parameters:
file -
permissions -

changePermissions

public void changePermissions(SftpFile file,
                              int permissions)
            throws IOException
Parameters:
file -
permissions -

closeFile

public void closeFile(SftpFile file)
            throws IOException
Parameters:
file -

closeHandle

protected void closeHandle(byte[] handle)
            throws IOException
Parameters:
handle -

createSymbolicLink

public void createSymbolicLink(String targetpath,
                               String linkpath)
            throws IOException
Parameters:
targetpath -
linkpath -

getAbsolutePath

public String getAbsolutePath(String path)
            throws IOException
Parameters:
path -
Returns:

getAbsolutePath

public String getAbsolutePath(SftpFile file)
            throws IOException
Parameters:
file -
Returns:

getAttributes

public FileAttributes getAttributes(String path)
            throws IOException
Parameters:
path -
Returns:

getAttributes

public FileAttributes getAttributes(SftpFile file)
            throws IOException
Parameters:
file -
Returns:

getDefaultDirectory

public String getDefaultDirectory()
            throws IOException
Returns:

getMaximumPacketSize

protected int getMaximumPacketSize()
Overrides:
getMaximumPacketSize in interface Channel
Returns:

getMaximumWindowSpace

protected int getMaximumWindowSpace()
Overrides:
getMaximumWindowSpace in interface Channel
Returns:

getMinimumWindowSpace

protected int getMinimumWindowSpace()
Overrides:
getMinimumWindowSpace in interface Channel
Returns:

getName

public String getName()
Overrides:
getName in interface Channel
Returns:

getSymbolicLinkTarget

public String getSymbolicLinkTarget(String linkpath)
            throws IOException
Parameters:
linkpath -
Returns:

initialize

public boolean initialize()
            throws IOException
Returns:

isValidHandle

protected boolean isValidHandle(byte[] handle)
Parameters:
handle -
Returns:

listChildren

public int listChildren(SftpFile file,
                        List children)
            throws IOException
Parameters:
file -
children -
Returns:

makeDirectory

public void makeDirectory(String path)
            throws IOException
Parameters:
path -

maximumPacketSize

protected long maximumPacketSize()
Returns:

openDirectory

public SftpFile openDirectory(String path)
            throws IOException
Parameters:
path -
Returns:

openFile

public SftpFile openFile(String filename,
                         int flags)
            throws IOException
Parameters:
filename -
flags -
Returns:

openFile

public SftpFile openFile(String absolutePath,
                         int flags,
                         FileAttributes attrs)
            throws IOException
Parameters:
absolutePath -
flags -
attrs -
Returns:

readFile

protected int readFile(byte[] handle,
                       UnsignedInteger64 offset,
                       byte[] output,
                       int off,
                       int len)
            throws IOException
Parameters:
handle -
offset -
output -
off -
len -
Returns:

recurseMakeDirectory

public void recurseMakeDirectory(String path)
            throws IOException
Parameters:
path -

removeDirectory

public void removeDirectory(String path)
            throws IOException
Parameters:
path -

removeFile

public void removeFile(String filename)
            throws IOException
Parameters:
filename -

renameFile

public void renameFile(String oldpath,
                       String newpath)
            throws IOException
Parameters:
oldpath -
newpath -

setAttributes

public void setAttributes(String path,
                          FileAttributes attrs)
            throws IOException
Parameters:
path -
attrs -

setAttributes

public void setAttributes(SftpFile file,
                          FileAttributes attrs)
            throws IOException
Parameters:
file -
attrs -

writeFile

protected void writeFile(byte[] handle,
                         UnsignedInteger64 offset,
                         byte[] data,
                         int off,
                         int len)
            throws IOException
Parameters:
handle -
offset -
data -
off -
len -

Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.