grib/src/main/java/ucar/nc2/grib/GribResourceReader.java
public static InputStream getInputStream(String resourceName) throws FileNotFoundException {

    // Try class loader to get resource
    ClassLoader cl = GribResourceReader.class.getClassLoader();
    InputStream s = cl.getResourceAsStream(resourceName);
    if (s != null) {
      return s;
    }

    // Try the file system
    File f = new File(resourceName);
    if (f.exists())
      return new FileInputStream(f);

    // give up
    throw new FileNotFoundException("Cant find resource "+resourceName);
  }
public static InputStream getInputStream(String resourceName) throws FileNotFoundException {

    // Try class loader to get resource
    ClassLoader cl = GribResourceReader.class.getClassLoader();
    InputStream s = cl.getResourceAsStream(resourceName);
    if (s != null) {
      return s;
    }

    // Try the file system
    File f = new File(resourceName);
    if (f.exists())
      return new FileInputStream(f);

    // give up
    throw new FileNotFoundException("Cant find resource "+resourceName);
  }
public static InputStream getInputStream ( String resourceName ) throws FileNotFoundException { // Try class loader to get resource
 ClassLoader cl = GribResourceReader . class . getClassLoader ( ) ; InputStream s = cl . getResourceAsStream ( resourceName ) ; if ( s != null ) { return s ; } // Try the file system
 File f = new File ( resourceName ) ; if ( f . exists ( ) ) return new FileInputStream ( f ) ; // give up
 throw new FileNotFoundException ( "Cant find resource " + resourceName ) ; }
Get the input stream to the given resource

@param resourceName The resource name. May be a resource on the class path or a file
@return The input stream to the resource
Get the input stream to the given resource