BEAST
eu.baltrad.beast.net.scp.SCPFileUploadHandler Class Reference

Upload files using SCP. More...

Inheritance diagram for eu.baltrad.beast.net.scp.SCPFileUploadHandler:
eu.baltrad.beast.net.FileUploadHandlerBase eu.baltrad.beast.net.FileUploadHandler eu.baltrad.beast.net.scp.SCPOnlyFileUploadHandler eu.baltrad.beast.net.sftp.SFTPFileUploadHandler

Public Member Functions

 SCPFileUploadHandler ()
 Default constructor.
 
void upload (File src, URI dst) throws IOException
 Upload a file.
 
- Public Member Functions inherited from eu.baltrad.beast.net.FileUploadHandlerBase
URI appendPath (URI uri, String path)
 append a path to an URI.
 

Protected Member Functions

SSHClient connect (URI uri) throws IOException
 
void disconnect (SSHClient client) throws IOException
 
void auth (SSHClient client, URI uri) throws IOException
 
void store (SSHClient client, File src, URI dst) throws IOException
 
int getPort (URI uri)
 
String getUser (URI uri)
 
String getPassword (URI uri)
 
String getPath (URI uri)
 
SSHClient acquireSSHClient ()
 
DefaultConfig createDefaultConfig ()
 

Static Protected Attributes

static final int DEFAULT_CONNECT_TIMEOUT = 10000
 
static final int DEFAULT_SOCKET_TIMEOUT = 60000
 

Detailed Description

Upload files using SCP.

Uses ~/.ssh/known_hosts and ~/.ssh/known_hosts2 for host verification and ~/.ssh/id_rsa and ~/.ssh/id_dsa for keys.

More thorough configuration could be provided through query arguments in the future.

Constructor & Destructor Documentation

◆ SCPFileUploadHandler()

eu.baltrad.beast.net.scp.SCPFileUploadHandler.SCPFileUploadHandler ( )
inline

Default constructor.

Member Function Documentation

◆ store()

void eu.baltrad.beast.net.scp.SCPFileUploadHandler.store ( SSHClient client,
File src,
URI dst ) throws IOException
inlineprotected

◆ upload()

void eu.baltrad.beast.net.scp.SCPFileUploadHandler.upload ( File src,
URI dst ) throws IOException
inline

Upload a file.

The implementations should determine if the dst refers to a file or a directory and in case of the former rename the file.

Parameters
srcthe file to copy
dstthe destination URI.
Exceptions
IOExceptionwhen copying fails

Implements eu.baltrad.beast.net.FileUploadHandler.


The documentation for this class was generated from the following file: