|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectp2pMapReduce.impl.ftp.FTPManagerImpl
public class FTPManagerImpl
An implementation of the FTPManager
interface based on apache
libraries.
An instance could be obtained by FTPManagerFactory.createFTPManager()
Every download path parameters must be a relative path
that refers to local ftp base directory as current directory.
No absolute paths are allowed
Constructor Summary | |
---|---|
FTPManagerImpl(java.io.File userPropFile,
int ftpPort)
|
Method Summary | |
---|---|
boolean |
download(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass,
java.lang.String[] path,
java.io.File[] dest,
boolean[] results)
Deprecated. |
boolean |
download(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass,
java.lang.String path,
java.io.File dest)
Deprecated. |
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 |
downloadDir(java.lang.String host,
int port,
java.lang.String dirPath)
Download the remote directory in a local directory which path is the same of the remote directory, relatively to the FTP home directory If necessary the directory is created |
boolean |
downloadDir(java.lang.String host,
int port,
java.lang.String dir,
java.lang.String destDir)
Download all the content from remote directory dir in the local 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. |
boolean |
downloadFile(java.lang.String host,
int port,
java.lang.String filePath)
Download the remote file in a local file which path is the same of the remote file, relatively to the FTP home directory If necessary the directory tree of the file is created |
boolean |
downloadFile(java.lang.String host,
int port,
java.lang.String srcFilePath,
java.lang.String dstFilePath)
Download the remote file in a local file which path is dstFilePath
relatively to the FTP home directory. |
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 |
boolean |
upload(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass,
java.io.File[] srcFiles,
java.lang.String[] destPaths,
java.lang.String[] destFileNames,
boolean[] results)
Deprecated. to test |
boolean |
upload(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass,
java.io.File[] srcFiles,
java.lang.String destPath,
java.lang.String[] destFileNames,
boolean[] results)
Deprecated. to test |
boolean |
uploadFile(NodeInfo remoteNode,
java.lang.String srcFilePath,
java.lang.String destPath,
java.lang.String destFileName)
|
boolean |
uploadFile(java.lang.String host,
int port,
java.lang.String srcFilePath,
java.lang.String destPath,
java.lang.String destFileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FTPManagerImpl(java.io.File userPropFile, int ftpPort)
Method Detail |
---|
public void startLocalServer() throws java.io.IOException
FTPManager
startLocalServer
in interface FTPManager
java.io.IOException
public java.lang.String getBaseDir()
getBaseDir
in interface FTPManager
null
if the
server has not been stared yetpublic java.lang.String getIpAddress()
InetAddress
which is not a loopback address
and return InetAddress.getHostAddress()
result.
If all InetAddress
are loopback addresses utilize
InetAddress.getLocalHost()
getIpAddress
in interface FTPManager
public int getFtpPort()
getFtpPort
in interface FTPManager
public boolean downloadFile(NodeInfo remoteNode, java.lang.String filePath)
FTPManager
downloadFile
in interface FTPManager
public boolean downloadFile(NodeInfo remoteNode, java.lang.String srcFilePath, java.lang.String dstFilePath)
FTPManager
srcFilePath
from the specified node.
The file will be downloaded in the specified path dstFilePath
which must contain also the file name.
downloadFile
in interface FTPManager
public boolean downloadFile(java.lang.String host, int port, java.lang.String filePath)
host
- port
- filePath
-
public boolean downloadFile(java.lang.String host, int port, java.lang.String srcFilePath, java.lang.String dstFilePath)
dstFilePath
relatively to the FTP home directory.
If necessary the directory tree of the file is created
host
- port
- filePath
- dstFilePath
-
public boolean downloadDir(NodeInfo remoteNode, java.lang.String dirPath)
FTPManager
dirPath
from
the specified node in a directory with the same path on the local ftp
base directory
downloadDir
in interface FTPManager
public boolean downloadDir(NodeInfo remoteNode, java.lang.String dirPath, java.lang.String destDir)
FTPManager
dirPath
from
the specified node in the directory destDir
downloadDir
in interface FTPManager
public boolean downloadDir(java.lang.String host, int port, java.lang.String dirPath)
host
- port
- dirPath
-
public boolean downloadDir(java.lang.String host, int port, java.lang.String dir, java.lang.String destDir)
host
- port
- dir
- destDir
-
public boolean download(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.lang.String[] path, java.io.File[] dest, boolean[] results)
host
- port
- user
- pass
- path
- dest
- results
-
public boolean download(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.lang.String path, java.io.File dest)
host
- port
- user
- pass
- path
- dest
-
public boolean uploadFile(NodeInfo remoteNode, java.lang.String srcFilePath, java.lang.String destPath, java.lang.String destFileName)
public boolean uploadFile(java.lang.String host, int port, java.lang.String srcFilePath, java.lang.String destPath, java.lang.String destFileName)
srcFilePath
- File da uplodaredest
- Path del file (dove salvarlo)dim
- la dimensione del file
public boolean upload(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.io.File[] srcFiles, java.lang.String destPath, java.lang.String[] destFileNames, boolean[] results)
host
- port
- user
- pass
- srcFiles
- destPath
- destFileNames
- results
-
public boolean upload(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.io.File[] srcFiles, java.lang.String[] destPaths, java.lang.String[] destFileNames, boolean[] results)
host
- port
- user
- pass
- srcFiles
- destPaths
- destFileNames
- results
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |