| |
|
| java.lang.Object com.ericdaugherty.sshwebproxy.SshChannel com.ericdaugherty.sshwebproxy.FileChannel
FileChannel | public class FileChannel extends SshChannel implements SshConstants(Code) | | Provide an implementation of the SshChannel for transfering
files over an SshConnection.
author: Eric Daugherty |
Constructor Summary | |
public | FileChannel(SshConnection sshConnection, SshClient sshClient) Opens a file transfer session with the server. |
FileChannel | public FileChannel(SshConnection sshConnection, SshClient sshClient) throws SshConnectException(Code) | | Opens a file transfer session with the server.
Parameters: sshConnection - the connection to use. Parameters: sshClient - the SSH API client. throws: SshConnectException - thrown if there is any error openingthe connection. |
changeDirectory | public boolean changeDirectory(String directory)(Code) | | Change to a different directory.
Parameters: directory - true if successful. |
close | public void close()(Code) | | Closes the Reader and Writer after the Channel has been closed.
This should only be called by the SshConnection
class and never directly called from this class.
|
downloadFile | public void downloadFile(String fileName, OutputStream outputStream) throws IOException(Code) | | Downloads a file from the remote server.
Parameters: fileName - the name of the file to download. Parameters: outputStream - the stream to write the downloaded file to. throws: IOException - thrown if there is an error reading the file. |
getCurrentDirectory | public String getCurrentDirectory()(Code) | | Returns the present working directory for this channel.
result of pwd command. |
getCurrentDirectoryListing | public List getCurrentDirectoryListing()(Code) | | Returns a listing of the current directory.
a valid list, or null if an error occured. |
getPage | public String getPage()(Code) | | Returns the page that should be used to display this Channel.
|
isConnected | public boolean isConnected()(Code) | | Indicates whether this connection is still active.
true if this connection is still active. |
uploadFile | public void uploadFile(String fileName, InputStream inputStream) throws IOException(Code) | | Uploads a file to the remote server.
Parameters: fileName - the file to upload. Parameters: inputStream - the file as an InputStream. throws: IOException - thrown if there is an error writing the file. |
|
|
|