p2pMapReduce.ftp
Interface FTPManager

All Known Implementing Classes:
FTPManagerImpl

public interface FTPManager

A component charged with ftp server and client functionality. An instance could be retrieved through FTPManagerFactory.createFTPManager()


Method Summary
 boolean downloadDir(NodeInfo remoteNode, java.lang.String dirPath)
          Download the content of the directory dirPath from the specified node in a directory with the same path on the local ftp base directory
 boolean downloadDir(NodeInfo remoteNode, java.lang.String dirPath, java.lang.String destDir)
          Download the content of the directory dirPath from the specified node in the directory destDir
 boolean downloadFile(NodeInfo remoteNode, java.lang.String filePath)
          Download the specified file from the specified node.
 boolean downloadFile(NodeInfo remoteNode, java.lang.String srcFilePath, java.lang.String dstFilePath)
          Download the file srcFilePath from the specified node.
 java.lang.String getBaseDir()
          Returns the path to the directory used as root directory by FTP server
 int getFtpPort()
          The local port on which FTP server listen
 java.lang.String getIpAddress()
          Find for a InetAddress which is not a loopback address and return InetAddress.getHostAddress() result.
 void startLocalServer()
          Starts the local ftp server
 

Method Detail

startLocalServer

void startLocalServer()
                      throws java.io.IOException
Starts the local ftp server

Throws:
java.io.IOException

getBaseDir

java.lang.String getBaseDir()
Returns the path to the directory used as root directory by FTP server

Returns:
The path to FTP server root directory, null if the server has not been stared yet

getFtpPort

int getFtpPort()
The local port on which FTP server listen

Returns:

getIpAddress

java.lang.String getIpAddress()
Find for a InetAddress which is not a loopback address and return InetAddress.getHostAddress() result. If all InetAddress are loopback addresses utilize InetAddress.getLocalHost()

Returns:
The string representation of the ip address for this FTP server

downloadDir

boolean downloadDir(NodeInfo remoteNode,
                    java.lang.String dirPath)
Download the content of the directory dirPath from the specified node in a directory with the same path on the local ftp base directory

Parameters:
remoteNode -
dirPath -
Returns:

downloadDir

boolean downloadDir(NodeInfo remoteNode,
                    java.lang.String dirPath,
                    java.lang.String destDir)
Download the content of the directory dirPath from the specified node in the directory destDir

Parameters:
remoteNode -
dirPath -
destDir -
Returns:
True if the operation is successfully completed

downloadFile

boolean downloadFile(NodeInfo remoteNode,
                     java.lang.String filePath)
Download the specified file from the specified node. The file will be downloaded in the same path in the local ftp base directory

Parameters:
remoteNode -
filePath -
Returns:

downloadFile

boolean downloadFile(NodeInfo remoteNode,
                     java.lang.String srcFilePath,
                     java.lang.String dstFilePath)
Download the file srcFilePath from the specified node. The file will be downloaded in the specified path dstFilePath which must contain also the file name.

Parameters:
remoteNode -
srcFilePath -
dstFilePath -
Returns: