Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.trapezium.parse
Class InputStreamFactory  view InputStreamFactory download InputStreamFactory.java

java.lang.Object
  extended bycom.trapezium.parse.InputStreamFactory

public class InputStreamFactory
extends java.lang.Object

Provides a static public method for creating an InputStream from a String indicating a file or URL.

Since:
1.0
Version:
1.0, 17 Nov 1997

Constructor Summary
private InputStreamFactory()
           
 
Method Summary
static java.io.InputStream getInputStream(java.io.File source)
          Get an InputStream from a File, handle gzipped files
static java.io.InputStream getInputStream(java.lang.String fileName)
          Creates an InputStream from a String indicating either a file or a URL.
static java.io.InputStream getRawInputStream(java.lang.String fileName)
          Convert a string url into an InputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamFactory

private InputStreamFactory()
Method Detail

getInputStream

public static java.io.InputStream getInputStream(java.lang.String fileName)
                                          throws java.io.FileNotFoundException,
                                                 java.io.IOException,
                                                 java.lang.NoClassDefFoundError
Creates an InputStream from a String indicating either a file or a URL. First tries to construct a URL, if this fails, assume it is a file. If using JDK 1.0.x, GZIPInputStream not available. If a GZIP file is encountered, we attempt to use this class, exception is caught, null returned.


getInputStream

public static java.io.InputStream getInputStream(java.io.File source)
                                          throws java.io.IOException
Get an InputStream from a File, handle gzipped files


getRawInputStream

public static java.io.InputStream getRawInputStream(java.lang.String fileName)
                                             throws java.io.FileNotFoundException,
                                                    java.io.IOException,
                                                    java.lang.NoClassDefFoundError
Convert a string url into an InputStream