public class PrintStreamMonitor extends Object implements org.ops4j.monitors.stream.StreamMonitor
System.out.
Example of usage;
StreamMonitor monitor = new PrintStreamMonitor( System.out );
StreamUtils.copyStream( monitor, sourceURL, length, srcStream, destStream, true );
| Constructor and Description |
|---|
PrintStreamMonitor(PrintStream out) |
| Modifier and Type | Method and Description |
|---|---|
void |
notifyCompletion(URL resource)
Notify the monitor of the successful completion of a download
process.
|
void |
notifyError(URL resource,
String message)
Notify the monitor of the an error during the download
process.
|
void |
notifyUpdate(URL resource,
int expected,
int count)
Notify the monitor of the update in the download status.
|
public PrintStreamMonitor(PrintStream out)
out - The PrintStream that should receive the monitored output.public void notifyUpdate(URL resource, int expected, int count)
notifyUpdate in interface org.ops4j.monitors.stream.StreamMonitorresource - the name of the remote resource being downloaded.expected - the expected number of bytes to be downloaded.count - the number of bytes downloaded.public void notifyCompletion(URL resource)
notifyCompletion in interface org.ops4j.monitors.stream.StreamMonitorresource - the name of the remote resource.public void notifyError(URL resource, String message)
notifyError in interface org.ops4j.monitors.stream.StreamMonitorresource - the name of the remote resource.message - a non-localized message describing the problem in english.Copyright © 2006–2019 OPS4J - Open Participation Software for Java. All rights reserved.