de.jw.cloud42.webservice
Class Cloud42FileService

java.lang.Object
  extended by de.jw.cloud42.webservice.Cloud42FileService

public class Cloud42FileService
extends java.lang.Object

Service class for Cloud42 Web service file transfer functions.

Author:
fbitzer

Constructor Summary
Cloud42FileService()
           
 
Method Summary
 javax.activation.DataHandler downloadFile(java.lang.String dnsName, java.lang.String rsaKey, java.lang.String fileName)
          Download a file from a remote host.
 RemoteResult uploadFile(java.lang.String dnsName, java.lang.String rsaKey, java.lang.String targetDir, java.lang.String targetFilename, byte[] fileData)
          Upload a file to an AMI instance.
 RemoteResult uploadFileFromURL(java.lang.String dnsName, java.lang.String rsaKey, java.lang.String targetDir, java.lang.String targetFilename, java.lang.String url)
          Upload a file from an URL to an AMI instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cloud42FileService

public Cloud42FileService()
Method Detail

uploadFile

public RemoteResult uploadFile(java.lang.String dnsName,
                               java.lang.String rsaKey,
                               java.lang.String targetDir,
                               java.lang.String targetFilename,
                               byte[] fileData)
Upload a file to an AMI instance.

Parameters:
dnsName - Hostname or IP address of remote host.
rsaKey - RSA private key to use for authentification.
targetDir - Target folder on remote machine.
targetFilename - Target filename on remote machine.
fileData - The uploaded file.
Returns:
RemoteResult with empty output if execution was successful or an exception message if not.

uploadFileFromURL

public RemoteResult uploadFileFromURL(java.lang.String dnsName,
                                      java.lang.String rsaKey,
                                      java.lang.String targetDir,
                                      java.lang.String targetFilename,
                                      java.lang.String url)
Upload a file from an URL to an AMI instance. Can be used to transfer files from S3 buckets to an instance. Uses wget for file transfer.

Parameters:
dnsName - Hostname or IP address of remote host/the running instance.
rsaKey - RSA private key to use for authentification.
targetDir - Target folder on remote machine.
targetFilename - Target filename on remote machine.
url - URL for download.
Returns:
RemoteResult encapsulating the output of the wget command.

downloadFile

public javax.activation.DataHandler downloadFile(java.lang.String dnsName,
                                                 java.lang.String rsaKey,
                                                 java.lang.String fileName)
Download a file from a remote host.

Parameters:
dnsName - Hostname or IP address of remote host.
rsaKey - RSA private key to use for authentification.
fileName - full path and name of file to download.
Returns:
MTOM message with requested file as attachment.


Copyright © 2010 just works! Software. All Rights Reserved.