jfileupload.transfer.client.ftp
Class FTPUploadTransfer

java.lang.Object
  extended by jfileupload.transfer.client.core.AbstractTransferController
      extended by jfileupload.transfer.client.ftp.FTPTransfer
          extended by jfileupload.transfer.client.ftp.FTPUploadTransfer
All Implemented Interfaces:
java.lang.Runnable, TransferController

public class FTPUploadTransfer
extends FTPTransfer
implements java.lang.Runnable

This class implements a TransferController for FTP protocol. It relies on Commons-Net for FTP commands.


Field Summary
static java.lang.String CHMODAFTERUPLOAD
           
static java.lang.String DELETEAFTERUPLOAD
           
static java.lang.String DELETEONFAIL
           
static java.lang.String NOTIFYRELATIVEFILENAME
           
static java.lang.String RELATIVEFILENAME
           
static java.lang.String RESUMECOMMAND
           
static java.lang.String SELECTEDFULLFILENAME
           
 
Fields inherited from class jfileupload.transfer.client.ftp.FTPTransfer
ACCOUNT, ACCOUNTCREATION, ACCOUNTCREATIONCHMOD, ACCOUNTPWD, commandMonitor, COMMANDMONITOR, DELETEFOLDER, DEPRECATEDPASSWORD, DEPRECATEDURL, DEPRECATEDUSERNAME, DISABLEAUTH, FTPCOMMANDMONITOR, FTPSESSION, FTPSMODE, FTPSPROT, PASV, REMOTEVERIFICATION, SITECOMMAND, targetURL, TRANSFERTYPE, wd, WEAKSSL
 
Fields inherited from class jfileupload.transfer.client.core.AbstractTransferController
BUFFERSIZE, GZIPEXTENSION, ZIPEXTENSION
 
Fields inherited from interface jfileupload.transfer.client.core.TransferController
COMPLETED_STATUS, MAX_AUTH_ATTEMPTS, PREPROCESSING_FILTER, RUNNING_STATUS, WAITING_STATUS
 
Constructor Summary
FTPUploadTransfer()
          This class implements FTP transfer.
 
Method Summary
 void begin()
          Start upload thread.
 void cancel()
          Cancel current upload by closing inputstream.
 java.lang.Object execute()
          NOT IMPLEMENTED for FTP UPLOAD transfer.
 void init()
          Inits FTP transfer (SSL Factory ...)
protected  void process(java.io.File current)
          Process upload tasks including filtering.
 void run()
          Main loop
protected  void transfer(java.io.File currentfile, java.util.HashMap meta)
          Upload current file with optional additional parameters.
protected  void transferAndRetry(java.io.File current, java.util.HashMap meta)
          Upload file with optional retry attempts if it fails.
 
Methods inherited from class jfileupload.transfer.client.ftp.FTPTransfer
chmod, closeCommandMonitor, connect, FTPConnect, FTPDisconnect, FTPDisconnect, getClient, makeAndChangeDirectory, normalizePath, notifyProtocolListeners, registerSSLSocketFactory, runCommandMonitor
 
Methods inherited from class jfileupload.transfer.client.core.AbstractTransferController
addChecksumListener, addCompressListener, addFilterListener, addProtocolListener, addSplitListener, addTransferListener, authenticate, checksumCompletedNotification, checksumStartedNotification, checkZipMaxSize, cleanFilter, cleanFilter, compress, compress, compressFolder, compressingNotification, compressionFailedNotification, computeChecksum, executeFilter, executeFilter, getAllowedSourceFiles, getAuthentication, getBlackList, getChecksumListeners, getChunks, getChunkSize, getCompressListeners, getCRC32, getEncoding, getExt, getFilter, getFilter, getFilterChain, getFilterIDs, getFilterImpl, getFilterImpl, getFilterListeners, getHidden, getLastChunkSize, getLong, getMaxDepth, getMaxFiles, getMaxSize, getMD5, getMinSize, getOverwrite, getParameters, getParamFile, getPassword, getPolicy, getPreProcessingFilter, getPreProcessingFilterImpl, getProtocolListeners, getRawConf, getResume, getResumeOffset, getRetry, getRetryDelay, getRootDir, getServerUrl, getSource, getSplitListeners, getStatus, getTarget, getTemplate, getTimeOut, getTmpDir, getTmpFolder, getTransferFileFilter, getTransferListeners, getUsername, getWhiteList, getZipFolder, getZipIgnoreList, getZipMaxSize, getZipOnFly, hexDump, isAllowed, isThreaded, recurse, recursiveCompress, removeChecksumListener, removeCompressListener, removeFilterListener, removeProtocolListener, removeSplitListener, removeTransferListener, rename, setAuthentication, setBlackList, setChunkSize, setEncoding, setExt, setFilter, setFilter, setFilterChain, setFilterIDs, setFilterImpl, setFilterImpl, setHidden, setMaxDepth, setMaxFiles, setMaxSize, setMinSize, setOverwrite, setParameters, setParamFile, setPassword, setPolicy, setPreProcessingFilter, setPreProcessingFilterImpl, setRawConf, setResume, setResumeOffset, setRetry, setRetryDelay, setRootDir, setServerUrl, setSource, setStatus, setTarget, setTemplate, setThreaded, setTimeOut, setTmpDir, setUsername, setWhiteList, setZipFolder, setZipIgnoreList, setZipMaxSize, setZipOnFly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELATIVEFILENAME

public static java.lang.String RELATIVEFILENAME

NOTIFYRELATIVEFILENAME

public static java.lang.String NOTIFYRELATIVEFILENAME

SELECTEDFULLFILENAME

public static java.lang.String SELECTEDFULLFILENAME

DELETEONFAIL

public static java.lang.String DELETEONFAIL

CHMODAFTERUPLOAD

public static java.lang.String CHMODAFTERUPLOAD

DELETEAFTERUPLOAD

public static java.lang.String DELETEAFTERUPLOAD

RESUMECOMMAND

public static java.lang.String RESUMECOMMAND
Constructor Detail

FTPUploadTransfer

public FTPUploadTransfer()
This class implements FTP transfer.

Method Detail

init

public void init()
          throws ClientException
Description copied from class: FTPTransfer
Inits FTP transfer (SSL Factory ...)

Specified by:
init in interface TransferController
Overrides:
init in class FTPTransfer
Throws:
ClientException

begin

public void begin()
Start upload thread.

Specified by:
begin in interface TransferController
Specified by:
begin in class FTPTransfer

run

public void run()
Main loop

Specified by:
run in interface java.lang.Runnable

process

protected void process(java.io.File current)
                throws ClientException
Process upload tasks including filtering.

Parameters:
current -
Throws:
ClientException

transferAndRetry

protected void transferAndRetry(java.io.File current,
                                java.util.HashMap meta)
                         throws ClientException
Upload file with optional retry attempts if it fails.

Parameters:
currentfile -
meta -
Throws:
ClientException

transfer

protected void transfer(java.io.File currentfile,
                        java.util.HashMap meta)
                 throws ClientException
Upload current file with optional additional parameters.

Parameters:
currentfile -
meta - additional parameters
Throws:
ClientException

cancel

public void cancel()
Cancel current upload by closing inputstream.

Specified by:
cancel in interface TransferController
Specified by:
cancel in class FTPTransfer

execute

public java.lang.Object execute()
                         throws ClientException
NOT IMPLEMENTED for FTP UPLOAD transfer. No need for synchronous transfer.

Specified by:
execute in interface TransferController
Specified by:
execute in class FTPTransfer
Throws:
ClientException