Class TransferManager
java.lang.Object
ecmwf.common.technical.TransferManager
-
Constructor Summary
ConstructorsConstructorDescriptionTransferManager(String command, long size) Instantiates a new transfer manager. -
Method Summary
Modifier and TypeMethodDescriptionvoidClose and interrupt if required.longGets the byte sent.longGets the duration.Gets the simplified rate.longGets the start time.voidsetDebug(boolean debug) Sets the debug.intwaitFor(String acknowledgement, ProgressHandler handler) Start the external process and tries to get the progress in percentage from the output (ending by "XX.XX%", e.g.
-
Constructor Details
-
TransferManager
Instantiates a new transfer manager.- Parameters:
command- the commandsize- the size
-
-
Method Details
-
waitFor
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 acknowledgementhandler- 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:
getDurationin interfaceProgressInterface- Returns:
- the duration
-
getStartTime
public long getStartTime()Gets the start time. Gets the start time.- Specified by:
getStartTimein interfaceProgressInterface- Returns:
- the start time
-
getByteSent
public long getByteSent()Gets the byte sent. Gets the byte sent.- Specified by:
getByteSentin interfaceProgressInterface- Returns:
- the byte sent
-
getSimplifiedRate
-
closeAndInterruptIfRequired
public void closeAndInterruptIfRequired()Close and interrupt if required. Close and interrupt if required.- Specified by:
closeAndInterruptIfRequiredin interfaceProgressInterface
-
setDebug
public void setDebug(boolean debug) Sets the debug.- Parameters:
debug- the new debug
-