Package ome.formats.importer.util
Class FileUploader
- java.lang.Object
-
- ome.formats.importer.util.FileUploader
-
- All Implemented Interfaces:
IObservable
public class FileUploader extends java.lang.Object implements IObservable
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringZIP_EXTENSIONThe extension used for the zip.
-
Constructor Summary
Constructors Constructor Description FileUploader(org.apache.http.impl.client.CloseableHttpClient httpClient)Initialize upload with httpClient
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddObserver(IObserver object)Add observer for notificationbooleandeleteObserver(IObserver object)Delete observervoidnotifyObservers(ImportEvent event)Notify observers of eventvoiduploadFiles(java.lang.String path, int timeout, ErrorContainer upload)Upload files from error container to url
-
-
-
Field Detail
-
ZIP_EXTENSION
public static final java.lang.String ZIP_EXTENSION
The extension used for the zip.- See Also:
- Constant Field Values
-
-
Method Detail
-
uploadFiles
public void uploadFiles(java.lang.String path, int timeout, ErrorContainer upload) throws HtmlMessengerExceptionUpload files from error container to url- Parameters:
path- the URL to which to POSTtimeout- the timeout (ignored)upload- the error container with files in it- Throws:
HtmlMessengerException- if the POST failed
-
addObserver
public boolean addObserver(IObserver object)
Description copied from interface:IObservableAdd observer for notification- Specified by:
addObserverin interfaceIObservable- Parameters:
object- - observer object- Returns:
- true if added
-
deleteObserver
public boolean deleteObserver(IObserver object)
Description copied from interface:IObservableDelete observer- Specified by:
deleteObserverin interfaceIObservable- Parameters:
object- - observer to delete- Returns:
- true if deleted
-
notifyObservers
public void notifyObservers(ImportEvent event)
Description copied from interface:IObservableNotify observers of event- Specified by:
notifyObserversin interfaceIObservable- Parameters:
event- - event that happened
-
-