|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.ethz.ssh2.SCPClient
public class SCPClient
A very basic SCPClient that can be used to copy files from/to
the SSH-2 server. On the server side, the "scp" program must be in the PATH.
SCPClient is
actually mapping every request to a distinct Session.
| Nested Class Summary | |
|---|---|
class |
SCPClient.LenNamePair
|
| Constructor Summary | |
|---|---|
SCPClient(Connection conn)
|
|
| Method Summary | |
|---|---|
SCPInputStream |
get(String remoteFile)
The session for opened for this SCP transfer must be closed using SCPInputStream#close |
String |
getCharset()
The currently used charset for filename encoding/decoding. |
protected SCPClient.LenNamePair |
parseCLine(String line)
|
SCPOutputStream |
put(String remoteFile,
long length,
String remoteTargetDirectory,
String mode)
The session for opened for this SCP transfer must be closed using SCPOutputStream#close |
protected void |
readResponse(InputStream is)
|
protected String |
receiveLine(InputStream is)
|
void |
setCharset(String charset)
Set the charset used to convert between Java Unicode Strings and byte encodings used by the server for paths and file names. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SCPClient(Connection conn)
| Method Detail |
|---|
public void setCharset(String charset)
throws IOException
charset - the name of the charset to be used or null to use the platform's
default encoding.
IOExceptiongetCharset()public String getCharset()
null if the platform's default charset is being used)setCharset(String)
protected void readResponse(InputStream is)
throws IOException
IOException
protected String receiveLine(InputStream is)
throws IOException
IOException
protected SCPClient.LenNamePair parseCLine(String line)
throws IOException
IOException
public SCPOutputStream put(String remoteFile,
long length,
String remoteTargetDirectory,
String mode)
throws IOException
remoteFile - length - The size of the file to sendremoteTargetDirectory - mode -
IOException
public SCPInputStream get(String remoteFile)
throws IOException
remoteFile -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||