|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.net.FTPConnector
public class FTPConnector
FTPConnector implements some useful methods for an FTP client. The methods are synchronized as they use an exclusive connection to the host for performing the operations.
This class uses the package package org.apache.commons.net.ftp,
which is available at http://jakarta.apache.org/commons/net/index.html.
Alternatively, you may also use the package com.oroinc.net.ftp from the Java NetComponents Library by Original Reusable Objects, which is available at this location. The license for that package is unfortunately NOT GNU, see here for details.
| Constructor Summary | |
|---|---|
FTPConnector(String host,
String user,
String passwd)
|
|
| Method Summary | |
|---|---|
void |
downloadFile(String remoteDir,
String remoteFileName,
File targetFile)
downloads a single file from the given FTP site to the specified target file. |
Object[] |
downloadTree(String remoteSourceDir,
File targetDir)
recursively downloads the remoteSourceDir tree to the targetDir. |
Object[] |
downloadTree(String remoteSourceDir,
File targetDir,
Logger logger)
uses a Logger to provide feedback. |
Object[] |
downloadTree(String remoteSourceDir,
File targetDir,
Logger logger,
Monitor monitor)
uses a Monitor for enabling to cancel the operation prematurely. |
Object[] |
synchronizeDirectory(File sourceDir,
String remoteTargetDir,
boolean deleteRemoteFiles)
synchronizes the sourceDir with the remoteTargetDir on the FTP host recursively. |
Object[] |
synchronizeDirectory(File sourceDir,
String remoteTargetDir,
boolean deleteRemoteFiles,
Logger logger)
This method allows for intermediate feedback through the logger; otherwise it's the same as the other synchronizeDirectory() method. |
Object[] |
synchronizeDirectory(File sourceDir,
String remoteTargetDir,
boolean deleteRemoteFiles,
Logger logger,
Monitor monitor)
This method allows for intermediate feedback and interactive stopping; otherwise it's the same as the other synchronizeDirectory() method. |
void |
uploadFile(File sourceFile,
String targetDir,
String targetFileName)
uploads a single local file to the given FTP site using the specified targetDir and targetFileName. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FTPConnector(String host,
String user,
String passwd)
| Method Detail |
|---|
public void uploadFile(File sourceFile,
String targetDir,
String targetFileName)
throws IOException
IOException
public void downloadFile(String remoteDir,
String remoteFileName,
File targetFile)
throws IOException
IOExceptionDownloader
public Object[] downloadTree(String remoteSourceDir,
File targetDir)
throws IOException
IOException
public Object[] downloadTree(String remoteSourceDir,
File targetDir,
Logger logger)
throws IOException
IOException(String, targetDir)
public Object[] downloadTree(String remoteSourceDir,
File targetDir,
Logger logger,
Monitor monitor)
throws IOException
IOException(String, targetDir, logger)
public Object[] synchronizeDirectory(File sourceDir,
String remoteTargetDir,
boolean deleteRemoteFiles)
throws IOException
IllegalArgumentException - if the sourceDir is not a directory
IOException
public Object[] synchronizeDirectory(File sourceDir,
String remoteTargetDir,
boolean deleteRemoteFiles,
Logger logger)
throws IOException
This method allows e.g. GUIs to display status messages by implementing
a special LogWriter.
The given logger may be null, otherwise its usage is as follows:
IOExceptionsynchronizeDirectory(File, String, boolean)
public Object[] synchronizeDirectory(File sourceDir,
String remoteTargetDir,
boolean deleteRemoteFiles,
Logger logger,
Monitor monitor)
throws IOException
This method allows monitoring threads to abort the synchronization by disabling the given monitor during processing. The monitor/logger may be null; monitor checks occur for each directory and after each copy operation.
IOExceptionsynchronizeDirectory(File, String, boolean, Logger)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||