|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sshtools.sftp.AbstractSftpClient
com.sshtools.sftp.subsystem.SftpClientImpl
public class SftpClientImpl
| Field Summary |
|---|
| Fields inherited from class com.sshtools.sftp.AbstractSftpClient |
|---|
ssh, umask |
| Fields inherited from interface com.sshtools.sftp.SftpClient |
|---|
EOL_CR, EOL_CRLF, EOL_LF, GlobSyntax, MODE_BINARY, MODE_TEXT, NoSyntax, Perl5Syntax |
| Constructor Summary | |
|---|---|
SftpClientImpl(SshClient ssh,
int maxVersion)
|
|
| Method Summary | |
|---|---|
protected void |
changeGroup(String gid,
String path)
|
protected void |
changeOwner(String uid,
String path)
|
protected void |
changePermissions(String filename,
int permissions)
|
protected void |
close()
|
protected void |
createSymbolicLink(String path,
String link)
|
protected SftpFileAttributes |
getAttributes(String file)
|
protected byte[] |
getCanonicalNewline()
|
SftpSubsystemChannel |
getChannel()
|
String |
getDefaultDirectory()
Get the default directory (or HOME directory) |
SftpFile |
getFile(String path)
|
InputStream |
getInputStream(String remotefile,
long position)
Create an InputStream for reading a remote file. |
OutputStream |
getOutputStream(String remotefile)
Create an OutputStream for writing to a remote file. |
protected String |
getRealPath(String path)
|
int |
getVersion()
|
boolean |
isClosed()
Returns the state of the SFTP client. |
SftpFile[] |
ls(String path)
List the contents remote directory. |
protected void |
makeDirectory(String dir,
SftpFileAttributes attrs)
|
protected void |
onInit(int maxVersion)
|
protected SftpFileAttributes |
performDownload(String remote,
OutputStream local,
FileTransferProgress progress,
long position)
|
protected void |
performUpload(InputStream in,
String path,
FileTransferProgress progress,
long position)
|
protected void |
removeDirectory(String filename)
|
protected void |
removeFile(String filename)
|
protected void |
renameFile(String from,
String to)
|
void |
setAttributes(String file,
SftpFileAttributes attrs)
Updates a file's attributes. |
| Methods inherited from class com.sshtools.sftp.AbstractSftpClient |
|---|
addCustomRoot, cd, cdup, chgrp, chmod, chown, copyLocalDirectory, copyRemoteDirectory, exit, formatLongname, formatLongname, get, get, get, get, get, get, get, get, get, get, get, get, getAbsolutePath, getCharsetEncoding, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getFiles, getInputStream, getTransferMode, isDirectoryOrLinkedDirectory, lcd, lpwd, ls, mkdir, mkdirs, put, put, put, put, put, put, put, put, put, put, put, put, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, putFiles, pwd, quit, removeCustomRoot, rename, resolveRemotePath, rm, rm, setRegularExpressionSyntax, setRemoteEOL, setTransferMode, stat, symlink, umask, umask, verifyConnection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SftpClientImpl(SshClient ssh,
int maxVersion)
throws SshException,
ChannelOpenException,
SftpStatusException
SshException
ChannelOpenException
SftpStatusException| Method Detail |
|---|
protected void onInit(int maxVersion)
throws SshException,
ChannelOpenException,
SftpStatusException
onInit in class AbstractSftpClientSshException
ChannelOpenException
SftpStatusException
public String getDefaultDirectory()
throws SftpStatusException,
SshException
SftpClientGet the default directory (or HOME directory)
SftpStatusException
SshException
protected void makeDirectory(String dir,
SftpFileAttributes attrs)
throws SftpStatusException,
SshException
makeDirectory in class AbstractSftpClientSftpStatusException
SshException
public SftpFile[] ls(String path)
throws SftpStatusException,
SshException
SftpClientList the contents remote directory.
Returns a list of SftpFile instances for the remote directory.
path - the path on the remote server to list
SftpStatusException
SshExceptionpublic SftpSubsystemChannel getChannel()
public InputStream getInputStream(String remotefile,
long position)
throws SftpStatusException,
SshException
SftpClient
SftpStatusException
SshException
public OutputStream getOutputStream(String remotefile)
throws SftpStatusException,
SshException
SftpClient
SftpStatusException
SshException
protected SftpFileAttributes getAttributes(String file)
throws SftpStatusException,
SshException
getAttributes in class AbstractSftpClientSftpStatusException
SshException
protected byte[] getCanonicalNewline()
throws SftpStatusException
getCanonicalNewline in class AbstractSftpClientSftpStatusException
protected SftpFileAttributes performDownload(String remote,
OutputStream local,
FileTransferProgress progress,
long position)
throws SftpStatusException,
TransferCancelledException,
SshException
performDownload in class AbstractSftpClientSftpStatusException
TransferCancelledException
SshExceptionpublic boolean isClosed()
SftpClient
Returns the state of the SFTP client. The client is closed if the
underlying session channel is closed. Invoking the quit
method of this object will close the underlying session channel.
isClosed in interface SftpClientisClosed in class AbstractSftpClient
public SftpFile getFile(String path)
throws SshException,
SftpStatusException
getFile in interface SftpClientgetFile in class AbstractSftpClientSshException
SftpStatusException
protected void performUpload(InputStream in,
String path,
FileTransferProgress progress,
long position)
throws SftpStatusException,
SshException,
TransferCancelledException
performUpload in class AbstractSftpClientSftpStatusException
SshException
TransferCancelledException
public void setAttributes(String file,
SftpFileAttributes attrs)
throws SftpStatusException,
SshException
SftpClient
Updates a file's attributes. Note, this may not be supported by the implementation (e.g. if
the SCP fallback is in use), so clients should catch the UnsupportedOperationException
and react accordingly.
file - the path of the fileattrs - the attributes to set
SftpStatusException
SshExceptionSftpClient.stat(String)
protected void changePermissions(String filename,
int permissions)
throws SftpStatusException,
SshException
changePermissions in class AbstractSftpClientSftpStatusException
SshException
protected void renameFile(String from,
String to)
throws SftpStatusException,
SshException
renameFile in class AbstractSftpClientSftpStatusException
SshException
protected void removeDirectory(String filename)
throws SftpStatusException,
SshException
removeDirectory in class AbstractSftpClientSftpStatusException
SshException
protected void removeFile(String filename)
throws SftpStatusException,
SshException
removeFile in class AbstractSftpClientSftpStatusException
SshException
protected void createSymbolicLink(String path,
String link)
throws SftpStatusException,
SshException
createSymbolicLink in class AbstractSftpClientSftpStatusException
SshException
protected String getRealPath(String path)
throws SftpStatusException,
SshException
getRealPath in class AbstractSftpClientSftpStatusException
SshException
protected void close()
throws SshIOException,
IOException
close in class AbstractSftpClientSshIOException
IOExceptionpublic int getVersion()
protected void changeGroup(String gid,
String path)
throws SftpStatusException,
SshException
changeGroup in class AbstractSftpClientSftpStatusException
SshException
protected void changeOwner(String uid,
String path)
throws SftpStatusException,
SshException
changeOwner in class AbstractSftpClientSftpStatusException
SshException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||