org.objectweb.proactive.filetransfer
Class FileTransfer

java.lang.Object
  extended by org.objectweb.proactive.filetransfer.FileTransfer

public class FileTransfer
extends java.lang.Object

This class provides a standard entry point for API FileTransfer tools.

Since:
ProActive 3.0.2 (Feb 2006)
Author:
The ProActive Team (mleyton)

Constructor Summary
FileTransfer()
           
 
Method Summary
static FileVector pullFile(Node node, java.io.File srcFile, java.io.File dstFile)
          Pulls a file from a remote node.
static FileVector pullFile(Node node, java.io.File srcFile, java.io.File dstFile, int bsize, int numFlyingBlocks)
           
static FileVector pullFiles(Node node, java.io.File[] srcFile, java.io.File[] dstFile)
          This method behaves like pullFile(Node, File, File), with the difference that it transfers multiple files.
static FileVector pullFiles(Node node, java.io.File[] srcFile, java.io.File[] dstFile, int bsize, int numFlyingBlocks)
           
static FileVector pushFile(Node node, java.io.File srcFile, java.io.File dstFile)
          Pushs a file from the local node to a remote node.
static FileVector pushFile(Node node, java.io.File srcFile, java.io.File dstFile, int bsize, int numFlyingBlocks)
           
static FileVector pushFile(Node node, FileVector srcFile, java.io.File dst)
           
static FileVector pushFiles(Node node, java.io.File[] srcFile, java.io.File[] dstFile)
          This method behaves like pushFile(Node, File, File), with the difference that it transfers multiple files.
static FileVector pushFiles(Node node, java.io.File[] srcFile, java.io.File[] dstFile, int bsize, int numFlyingBlocks)
           
static FileVector pushFiles(Node node, FileVector srcFile, java.io.File[] dst)
          Pushes a File to the node, while the file is being transferred from a previous operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTransfer

public FileTransfer()
Method Detail

pullFile

public static FileVector pullFile(Node node,
                                  java.io.File srcFile,
                                  java.io.File dstFile)
                           throws java.io.IOException,
                                  ProActiveException
Pulls a file from a remote node. This method behaves asynchronously.

Parameters:
node - The remote ProActive node.
srcFile - The source file in the remote node.
dstFile - The destination file in the local node.
Returns:
A FileWrapper instance containing a File object. This return value is a future, and to wait on it simply call the FileWrapper.getFiles() method.
Throws:
java.io.IOException - Problem with permissions, files not found, etc.
ProActiveException - Problems with communication like node unreachable, etc.

pullFile

public static FileVector pullFile(Node node,
                                  java.io.File srcFile,
                                  java.io.File dstFile,
                                  int bsize,
                                  int numFlyingBlocks)
                           throws java.io.IOException,
                                  ProActiveException
Throws:
java.io.IOException
ProActiveException

pullFiles

public static FileVector pullFiles(Node node,
                                   java.io.File[] srcFile,
                                   java.io.File[] dstFile)
                            throws java.io.IOException,
                                   ProActiveException
This method behaves like pullFile(Node, File, File), with the difference that it transfers multiple files. When performing a FileWrapper.getFiles() on the returned object, the wait-by-necessity mechanism will block the calling thread until all files have been pulled.

Throws:
java.io.IOException
ProActiveException

pullFiles

public static FileVector pullFiles(Node node,
                                   java.io.File[] srcFile,
                                   java.io.File[] dstFile,
                                   int bsize,
                                   int numFlyingBlocks)
                            throws java.io.IOException,
                                   ProActiveException
Throws:
java.io.IOException
ProActiveException

pushFile

public static FileVector pushFile(Node node,
                                  java.io.File srcFile,
                                  java.io.File dstFile)
                           throws java.io.IOException,
                                  ProActiveException
Pushs a file from the local node to a remote node. This method behaves asynchronously.

Parameters:
node - The remote ProActive node.
srcFile - The source file in the local node.
dstFile - The destination file in the remote node.
Returns:
A future of a BooleanWrapper. Accessing this variable will cause the block of the calling thread until the file has been fully received at the remote node.
Throws:
java.io.IOException - Problem with permissions, files not found, etc.
ProActiveException - Problems with communication like node unreachable, etc.

pushFile

public static FileVector pushFile(Node node,
                                  java.io.File srcFile,
                                  java.io.File dstFile,
                                  int bsize,
                                  int numFlyingBlocks)
                           throws java.io.IOException,
                                  ProActiveException
Throws:
java.io.IOException
ProActiveException

pushFiles

public static FileVector pushFiles(Node node,
                                   java.io.File[] srcFile,
                                   java.io.File[] dstFile)
                            throws java.io.IOException,
                                   ProActiveException
This method behaves like pushFile(Node, File, File), with the difference that it transfers multiple files. Accessing the future BooleanWrapper will block the thread, until all files have been pushed to the remote node.

Throws:
java.io.IOException
ProActiveException

pushFiles

public static FileVector pushFiles(Node node,
                                   java.io.File[] srcFile,
                                   java.io.File[] dstFile,
                                   int bsize,
                                   int numFlyingBlocks)
                            throws java.io.IOException,
                                   ProActiveException
Throws:
java.io.IOException
ProActiveException

pushFile

public static FileVector pushFile(Node node,
                                  FileVector srcFile,
                                  java.io.File dst)
                           throws java.io.IOException,
                                  ProActiveException
Throws:
java.io.IOException
ProActiveException

pushFiles

public static FileVector pushFiles(Node node,
                                   FileVector srcFile,
                                   java.io.File[] dst)
                            throws ProActiveException
Pushes a File to the node, while the file is being transferred from a previous operation. This methods is HIGHLY EXPERIMENTAL, and should be used with caution.

Parameters:
node - The node to where the file will be transferred/
srcFile - The source files which correspond to the result of another file transfer operation.
dst - The destination names of the files.
Returns:
A vector holding the futures of the files being transferred. The futures will be updated once this operation is finished.
Throws:
ProActiveException - If the srcFile vector and the dst array length do not match.


Copyright 2001-2007 INRIA All Rights Reserved.