wt.clients.util.http
Class HTTPUploadDownloadView.HTTPUploadDownloadController

java.lang.Object
  extended bywt.clients.util.http.HTTPUploadDownloadListenerSupport
      extended bywt.clients.util.http.HTTPUploadDownloadView.HTTPUploadDownloadController
All Implemented Interfaces:
EventListener, HTTPUploadDownloadListener
Enclosing class:
HTTPUploadDownloadView

class HTTPUploadDownloadView.HTTPUploadDownloadController
extends HTTPUploadDownloadListenerSupport


Field Summary
private  DownloadProgressDialog downloadProgressDialog
           
 
Constructor Summary
(package private) HTTPUploadDownloadView.HTTPUploadDownloadController()
           
 
Method Summary
 void confirmFileOverwrite(String path, int index)
          Confirm file overwrite.
 void fileOperationProgress(int thisFile, int totalFiles, int count)
          Notification of file transfer progress if file quantity is available.
 void fileOperationProgress(int thisFile, int totalFiles, long count)
          Notification of file transfer progress if file quantity is available.
 void fileOperationProgress(String path, int fileIndex, int count)
          Notification of file transfer progress if filepath is available.
 void fileOperationProgress(String path, int fileIndex, long count)
          Notification of file transfer progress if filepath is available.
 void fileOperationStatusChange(String path, int index, int status)
          Notification of individual upload/download status change.
 void fileOperationTypeUnknown(URL url, String filePath, int fileIndex)
          Callback invoked on listener when the HTTPUploadDownload processes a file for which the operation type is unknown.
 void invalidFile(String path, int index, int operationType, String reason)
          Callback to inform listener that an invalid file download was requested.
 void invalidFile(String filePath, int fileIndex, int operationType, String messageKey, Object[] params)
          The file at fileIndex is invalid.
 void locateFile(String path, int index, int operationType)
          Callback to inform listener that a file is needed.
 void openApplication(String path, int fileIndex)
          Call back invoked when HTTPUploadDownload has encountered a file which should be opened in an application.
 void openURL(URL url, int fileIndex)
          Call back invoked when HTTPUploadDownload has encountered a url which should be opened.
 
Methods inherited from class wt.clients.util.http.HTTPUploadDownloadListenerSupport
operationFinished, operationStatusChange, propertyChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

downloadProgressDialog

private DownloadProgressDialog downloadProgressDialog
Constructor Detail

HTTPUploadDownloadView.HTTPUploadDownloadController

HTTPUploadDownloadView.HTTPUploadDownloadController()
Method Detail

fileOperationStatusChange

public void fileOperationStatusChange(String path,
                                      int index,
                                      int status)
Notification of individual upload/download status change.

Specified by:
fileOperationStatusChange in interface HTTPUploadDownloadListener
Overrides:
fileOperationStatusChange in class HTTPUploadDownloadListenerSupport

fileOperationProgress

public void fileOperationProgress(String path,
                                  int fileIndex,
                                  int count)
Description copied from class: HTTPUploadDownloadListenerSupport
Notification of file transfer progress if filepath is available.

Specified by:
fileOperationProgress in interface HTTPUploadDownloadListener
Overrides:
fileOperationProgress in class HTTPUploadDownloadListenerSupport

fileOperationProgress

public void fileOperationProgress(String path,
                                  int fileIndex,
                                  long count)
Description copied from class: HTTPUploadDownloadListenerSupport
Notification of file transfer progress if filepath is available.

Specified by:
fileOperationProgress in interface HTTPUploadDownloadListener
Overrides:
fileOperationProgress in class HTTPUploadDownloadListenerSupport

fileOperationProgress

public void fileOperationProgress(int thisFile,
                                  int totalFiles,
                                  int count)
Description copied from class: HTTPUploadDownloadListenerSupport
Notification of file transfer progress if file quantity is available.

Specified by:
fileOperationProgress in interface HTTPUploadDownloadListener
Overrides:
fileOperationProgress in class HTTPUploadDownloadListenerSupport

fileOperationProgress

public void fileOperationProgress(int thisFile,
                                  int totalFiles,
                                  long count)
Description copied from class: HTTPUploadDownloadListenerSupport
Notification of file transfer progress if file quantity is available.

Specified by:
fileOperationProgress in interface HTTPUploadDownloadListener
Overrides:
fileOperationProgress in class HTTPUploadDownloadListenerSupport

confirmFileOverwrite

public void confirmFileOverwrite(String path,
                                 int index)
Description copied from class: HTTPUploadDownloadListenerSupport
Confirm file overwrite. If the overwrite is ok the listener should call

Specified by:
confirmFileOverwrite in interface HTTPUploadDownloadListener
Overrides:
confirmFileOverwrite in class HTTPUploadDownloadListenerSupport

locateFile

public void locateFile(String path,
                       int index,
                       int operationType)
Callback to inform listener that a file is needed. The listener may determine and set the path for the entry. If the listener does attempt to determine a local file path, this should be done without launching a new thread as the download operation will continue upon return from the downloadPathNotSet() method.

Specified by:
locateFile in interface HTTPUploadDownloadListener
Overrides:
locateFile in class HTTPUploadDownloadListenerSupport
Parameters:
path - the local file path.
index - the index of the file entry.
operationType - operation type OPERATION_TYPE_UPLOAD or OPERATION_TYPE_DOWNLOAD.

invalidFile

public void invalidFile(String path,
                        int index,
                        int operationType,
                        String reason)
Callback to inform listener that an invalid file download was requested. The listener may determine and set the path for the entry. If the listener does attempt to determine a local file path, this should be done without launching a new thread as the download operation will continue upon return from the downloadPathNotSet() method.

Specified by:
invalidFile in interface HTTPUploadDownloadListener
Overrides:
invalidFile in class HTTPUploadDownloadListenerSupport
Parameters:
path - the local file path.
index - the index of the file entry.
operationType - operation type OPERATION_TYPE_UPLOAD or OPERATION_TYPE_DOWNLOAD.
reason - the reason the file is invalid.

invalidFile

public void invalidFile(String filePath,
                        int fileIndex,
                        int operationType,
                        String messageKey,
                        Object[] params)
The file at fileIndex is invalid.

Specified by:
invalidFile in interface HTTPUploadDownloadListener
Overrides:
invalidFile in class HTTPUploadDownloadListenerSupport
Parameters:
filePath - the local file path.
fileIndex - the index of the file entry.
operationType - operation type OPERATION_TYPE_UPLOAD or OPERATION_TYPE_DOWNLOAD.
messageKey - the resource bundle key to the reason message
params - the text inserts for the reason message

fileOperationTypeUnknown

public void fileOperationTypeUnknown(URL url,
                                     String filePath,
                                     int fileIndex)
Callback invoked on listener when the HTTPUploadDownload processes a file for which the operation type is unknown. Valid file operation types are HTTPUploadDownload.FILE_OPERATION_TYPE_TRANSFER and HTTPUploadDownload.FILE_OPERATION_TYPE_OPEN. The listener can assert the appropriate type by calling HTTPUploadDownload.setFileOPerationType specifying one these two values.

Specified by:
fileOperationTypeUnknown in interface HTTPUploadDownloadListener
Overrides:
fileOperationTypeUnknown in class HTTPUploadDownloadListenerSupport

openURL

public void openURL(URL url,
                    int fileIndex)
Description copied from class: HTTPUploadDownloadListenerSupport
Call back invoked when HTTPUploadDownload has encountered a url which should be opened.

Specified by:
openURL in interface HTTPUploadDownloadListener
Overrides:
openURL in class HTTPUploadDownloadListenerSupport

openApplication

public void openApplication(String path,
                            int fileIndex)
Call back invoked when HTTPUploadDownload has encountered a file which should be opened in an application.

Specified by:
openApplication in interface HTTPUploadDownloadListener
Overrides:
openApplication in class HTTPUploadDownloadListenerSupport