org.apache.ant.compress.util
Class StreamHelper

java.lang.Object
  extended by org.apache.ant.compress.util.StreamHelper

public class StreamHelper
extends java.lang.Object

Helper methods that deal with FileAware*Factory and Resources that may or may not provide files.


Method Summary
static org.apache.commons.compress.archivers.ArchiveInputStream getInputStream(ArchiveStreamFactory factory, org.apache.tools.ant.types.Resource r, java.lang.String encoding)
          If the factory knows about files and the resource can provide one, returns an ArchiveInputStream for it, otherwise returns null.
static org.apache.commons.compress.compressors.CompressorInputStream getInputStream(CompressorStreamFactory factory, org.apache.tools.ant.types.Resource r)
          If the factory knows about files and the resource can provide one, returns an CompressorInputStream for it, otherwise returns null.
static org.apache.commons.compress.archivers.ArchiveOutputStream getOutputStream(ArchiveStreamFactory factory, org.apache.tools.ant.types.Resource r, java.lang.String encoding)
          If the factory knows about files and the resource can provide one, returns an ArchiveOutputStream for it, otherwise returns null.
static org.apache.commons.compress.compressors.CompressorOutputStream getOutputStream(CompressorStreamFactory factory, org.apache.tools.ant.types.Resource r)
          If the factory knows about files and the resource can provide one, returns an CompressorOutputStream for it, otherwise returns null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInputStream

public static org.apache.commons.compress.archivers.ArchiveInputStream getInputStream(ArchiveStreamFactory factory,
                                                                                      org.apache.tools.ant.types.Resource r,
                                                                                      java.lang.String encoding)
                                                                               throws java.io.IOException
If the factory knows about files and the resource can provide one, returns an ArchiveInputStream for it, otherwise returns null.

Parameters:
r - the resource to read from
encoding - the encoding of the entry names
Throws:
java.io.IOException

getOutputStream

public static org.apache.commons.compress.archivers.ArchiveOutputStream getOutputStream(ArchiveStreamFactory factory,
                                                                                        org.apache.tools.ant.types.Resource r,
                                                                                        java.lang.String encoding)
                                                                                 throws java.io.IOException
If the factory knows about files and the resource can provide one, returns an ArchiveOutputStream for it, otherwise returns null.

Parameters:
r - the resource to write to
encoding - the encoding of the entry names
Throws:
java.io.IOException

getInputStream

public static org.apache.commons.compress.compressors.CompressorInputStream getInputStream(CompressorStreamFactory factory,
                                                                                           org.apache.tools.ant.types.Resource r)
                                                                                    throws java.io.IOException
If the factory knows about files and the resource can provide one, returns an CompressorInputStream for it, otherwise returns null.

Parameters:
r - the resource to read from
encoding - the encoding of the entry names
Throws:
java.io.IOException

getOutputStream

public static org.apache.commons.compress.compressors.CompressorOutputStream getOutputStream(CompressorStreamFactory factory,
                                                                                             org.apache.tools.ant.types.Resource r)
                                                                                      throws java.io.IOException
If the factory knows about files and the resource can provide one, returns an CompressorOutputStream for it, otherwise returns null.

Parameters:
r - the resource to write to
Throws:
java.io.IOException