ucar.grib
Class GribResourceReader

java.lang.Object
  extended by ucar.grib.GribResourceReader

public abstract class GribResourceReader
extends java.lang.Object

A class that allows external packages to define how to read resource files.

Version:
2.0
Author:
Jeff McWhirter 02/07/2007

Constructor Summary
GribResourceReader()
           
 
Method Summary
static java.lang.String getFileRoot(java.lang.String f)
          _more_
static java.io.InputStream getInputStream(java.lang.String resourceName)
          Get the input stream to the given resource
static java.io.InputStream getInputStream(java.lang.String resourceName, java.lang.Class originClass)
          Get the input stream to the given resource
abstract  java.io.InputStream openInputStream(java.lang.String resourceName)
          Ovderridden by instances of the singleton
static void setGribResourceReader(GribResourceReader reader)
          Set the singleton reader.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GribResourceReader

public GribResourceReader()
Method Detail

setGribResourceReader

public static void setGribResourceReader(GribResourceReader reader)
Set the singleton reader. This is used to read in resources and can be set by external packages

Parameters:
reader - The reader

openInputStream

public abstract java.io.InputStream openInputStream(java.lang.String resourceName)
                                             throws java.io.IOException
Ovderridden by instances of the singleton

Parameters:
resourceName - The resource name. May be a file, url, java resource, etc.
Returns:
The input stream to the resource
Throws:
java.io.IOException - _more_

getInputStream

public static java.io.InputStream getInputStream(java.lang.String resourceName)
Get the input stream to the given resource

Parameters:
resourceName - The resource name. May be a file, url, java resource, etc.
Returns:
The input stream to the resource

getInputStream

public static java.io.InputStream getInputStream(java.lang.String resourceName,
                                                 java.lang.Class originClass)
Get the input stream to the given resource

Parameters:
resourceName - The resource name. May be a file, url, java resource, etc.
originClass - If non-null we use this to find java resources that are relative to a class
Returns:
The input stream to the resource

getFileRoot

public static java.lang.String getFileRoot(java.lang.String f)
_more_

Parameters:
f - _more_
Returns:
_more_