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 TypeMethodDescriptionvoid
Close and interrupt if required.long
Gets the byte sent.long
Gets the duration.Gets the simplified rate.long
Gets the start time.void
setDebug
(boolean debug) Sets the debug.int
waitFor
(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:
getDuration
in interfaceProgressInterface
- Returns:
- the duration
-
getStartTime
public long getStartTime()Gets the start time. Gets the start time.- Specified by:
getStartTime
in interfaceProgressInterface
- Returns:
- the start time
-
getByteSent
public long getByteSent()Gets the byte sent. Gets the byte sent.- Specified by:
getByteSent
in interfaceProgressInterface
- Returns:
- the byte sent
-
getSimplifiedRate
-
closeAndInterruptIfRequired
public void closeAndInterruptIfRequired()Close and interrupt if required. Close and interrupt if required.- Specified by:
closeAndInterruptIfRequired
in interfaceProgressInterface
-
setDebug
public void setDebug(boolean debug) Sets the debug.- Parameters:
debug
- the new debug
-