Class PutFileEventHandler

  • All Implemented Interfaces:
    org.bitrepository.client.eventhandler.EventHandler

    public class PutFileEventHandler
    extends java.lang.Object
    implements org.bitrepository.client.eventhandler.EventHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      PutFileEventHandler​(java.util.List<java.lang.String> pillars, java.io.File targetFile, java.net.URL uploadURL)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleEvent​(org.bitrepository.client.eventhandler.OperationEvent event)  
      boolean hasFailed()
      Method to determine if the operation was successful.
      void waitForFinish()
      Method to wait for the operation to complete.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PutFileEventHandler

        public PutFileEventHandler​(java.util.List<java.lang.String> pillars,
                                   java.io.File targetFile,
                                   java.net.URL uploadURL)
        Constructor
        Parameters:
        pillars - A list of pillars the file is put to
        targetFile - The file to put in the bitrepository
        uploadURL - The url where the file is uploaded to if the action is successful
    • Method Detail

      • handleEvent

        public void handleEvent​(org.bitrepository.client.eventhandler.OperationEvent event)
        Specified by:
        handleEvent in interface org.bitrepository.client.eventhandler.EventHandler
      • waitForFinish

        public void waitForFinish()
                           throws java.lang.InterruptedException
        Method to wait for the operation to complete. The method is blocking.
        Throws:
        java.lang.InterruptedException - if the thread is interrupted
      • hasFailed

        public boolean hasFailed()
        Method to determine if the operation was successful. Unlike the other operations, the putFile operation allows some failures determined by a setting. The method should not be called prior to a call to waitForFinish() have returned.
        Returns:
        true if the operation succeeded, otherwise false.