Class TransferManager

java.lang.Object
ecmwf.common.technical.TransferManager
All Implemented Interfaces:
ProgressInterface

public class TransferManager extends Object implements ProgressInterface
The Class TransferManager.
  • Constructor Details

    • TransferManager

      public TransferManager(String command, long size)
      Instantiates a new transfer manager.
      Parameters:
      command - the command
      size - the size
  • Method Details

    • waitFor

      public int waitFor(String acknowledgement, ProgressHandler handler) throws IOException
      Start the external process and tries to get the progress in percentage from the output (ending by "XX.XX%", e.g. "progress: 12.98%") to update the ProgressHandler. If an acknowledgement is provided then it tries to get it in the last line.
      Parameters:
      acknowledgement - the acknowledgement
      handler - the handler
      Returns:
      the int
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDuration

      public long getDuration()
      Gets the duration. Gets the duration.
      Specified by:
      getDuration in interface ProgressInterface
      Returns:
      the duration
    • getStartTime

      public long getStartTime()
      Gets the start time. Gets the start time.
      Specified by:
      getStartTime in interface ProgressInterface
      Returns:
      the start time
    • getByteSent

      public long getByteSent()
      Gets the byte sent. Gets the byte sent.
      Specified by:
      getByteSent in interface ProgressInterface
      Returns:
      the byte sent
    • getSimplifiedRate

      public String getSimplifiedRate()
      Gets the simplified rate.
      Returns:
      the simplified rate
    • closeAndInterruptIfRequired

      public void closeAndInterruptIfRequired()
      Close and interrupt if required. Close and interrupt if required.
      Specified by:
      closeAndInterruptIfRequired in interface ProgressInterface
    • setDebug

      public void setDebug(boolean debug)
      Sets the debug.
      Parameters:
      debug - the new debug