gov.lanl.Utility
Class IOHelper

java.lang.Object
  |
  +--gov.lanl.Utility.IOHelper

public class IOHelper
extends java.lang.Object

Static class to handle recurring problem of opening a file or resource wherever it may be

 

Constructor Summary
IOHelper()
           
 
Method Summary
static java.io.InputStream getInputStream(java.lang.String ref)
          This method returns a java.io.InputStream associated with a String representing a resource type.
static void main(java.lang.String[] arg)
          Main test program for reading in a stream resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOHelper

public IOHelper()
Method Detail

getInputStream

public static java.io.InputStream getInputStream(java.lang.String ref)
                                          throws java.io.IOException
This method returns a java.io.InputStream associated with a String representing a resource type. It tries to open it as a file, as a resource, and then as a URL. Failures throw a java.io.IOExceptoin

Throws:
java.io.IOException
Parameters:
ref - a String representing a resource path or URL
Returns:
a java.io.InputStream associated with that resource

main

public static void main(java.lang.String[] arg)
Main test program for reading in a stream resource