Class 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.String ZIP_EXTENSION
      The extension used for the zip.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileUploader​(org.apache.http.impl.client.CloseableHttpClient httpClient)
      Initialize upload with httpClient
    • Field Detail

      • ZIP_EXTENSION

        public static final java.lang.String ZIP_EXTENSION
        The extension used for the zip.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FileUploader

        public FileUploader​(org.apache.http.impl.client.CloseableHttpClient httpClient)
        Initialize upload with httpClient
        Parameters:
        httpClient - the HTTP client to use
    • Method Detail

      • uploadFiles

        public void uploadFiles​(java.lang.String path,
                                int timeout,
                                ErrorContainer upload)
                         throws HtmlMessengerException
        Upload files from error container to url
        Parameters:
        path - the URL to which to POST
        timeout - 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: IObservable
        Add observer for notification
        Specified by:
        addObserver in interface IObservable
        Parameters:
        object - - observer object
        Returns:
        true if added
      • deleteObserver

        public boolean deleteObserver​(IObserver object)
        Description copied from interface: IObservable
        Delete observer
        Specified by:
        deleteObserver in interface IObservable
        Parameters:
        object - - observer to delete
        Returns:
        true if deleted
      • notifyObservers

        public void notifyObservers​(ImportEvent event)
        Description copied from interface: IObservable
        Notify observers of event
        Specified by:
        notifyObservers in interface IObservable
        Parameters:
        event - - event that happened