org.ops4j.pax.runner.platform.internal
Class StreamUtils

java.lang.Object
  extended by org.ops4j.pax.runner.platform.internal.StreamUtils

public class StreamUtils
extends java.lang.Object

Stream related utilities. TODO add units tests

Since:
August 19, 2007
Author:
Alin Dreghiciu

Nested Class Summary
static class StreamUtils.CoarseGrainedProgressBar
          A progress bar that displayed corse grained information about downloading of an artifact
static class StreamUtils.FineGrainedProgressBar
          A progress bar that displayed detailed information about downloading of an artifact
static class StreamUtils.NullProgressBar
          A progress bar that does nothing = does not display anything on console.
static interface StreamUtils.ProgressBar
          Feddback for downloading process.
 
Method Summary
static void streamCopy(java.io.InputStream in, java.io.BufferedOutputStream out, StreamUtils.ProgressBar progressBar)
          Copy a stream to a destination.
static void streamCopy(java.net.URL url, java.io.BufferedOutputStream out, StreamUtils.ProgressBar progressBar)
          Copy a stream from an urlto a destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

streamCopy

public static void streamCopy(java.io.InputStream in,
                              java.io.BufferedOutputStream out,
                              StreamUtils.ProgressBar progressBar)
                       throws java.io.IOException
Copy a stream to a destination. It does not close the streams.

Parameters:
in - the stream to copy from
out - the stream to copy to
progressBar - download progress feedback. Can be null.
Throws:
java.io.IOException - re-thrown

streamCopy

public static void streamCopy(java.net.URL url,
                              java.io.BufferedOutputStream out,
                              StreamUtils.ProgressBar progressBar)
                       throws java.io.IOException
Copy a stream from an urlto a destination.

Parameters:
url - the url to copy from
out - the stream to copy to
progressBar - download progress feedback. Can be null.
Throws:
java.io.IOException - re-thrown


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.