cdm/src/main/java/ucar/util/prefs/XMLStore.java
static public XMLStore createFromResource(String resourceName, XMLStore storedDefaults)
         throws java.io.IOException {

    // open files if exist
    Class c = XMLStore.class;
    InputStream primIS = c.getResourceAsStream(resourceName);
    InputStream objIS = c.getResourceAsStream(resourceName);

    // debug
//    InputStream debugIS = c.getResourceAsStream(fileName);
  //  System.out.println("Resource stream= "+fileName);
    //thredds.util.IO.copy(debugIS, System.out);

    if (primIS == null) {
      //System.out.println("classLoader="+new XMLStore().getClass().getClassLoader());
      throw new java.io.IOException("XMLStore.createFromResource cant find <"+resourceName+">");
    }

    if (debugWhichStore) System.out.println("XMLStore read from resource "+resourceName);
    return new XMLStore( primIS, objIS, storedDefaults);
  }
static public XMLStore createFromResource(String resourceName, XMLStore storedDefaults)
         throws java.io.IOException {

    // open files if exist
    Class c = XMLStore.class;
    InputStream primIS = c.getResourceAsStream(resourceName);
    InputStream objIS = c.getResourceAsStream(resourceName);

    // debug
//    InputStream debugIS = c.getResourceAsStream(fileName);
  //  System.out.println("Resource stream= "+fileName);
    //thredds.util.IO.copy(debugIS, System.out);

    if (primIS == null) {
      //System.out.println("classLoader="+new XMLStore().getClass().getClassLoader());
      throw new java.io.IOException("XMLStore.createFromResource cant find <"+resourceName+">");
    }

    if (debugWhichStore) System.out.println("XMLStore read from resource "+resourceName);
    return new XMLStore( primIS, objIS, storedDefaults);
  }
static public XMLStore createFromResource ( String resourceName , XMLStore storedDefaults ) throws java . io . IOException { // open files if exist Class c = XMLStore . class ; InputStream primIS = c . getResourceAsStream ( resourceName ) ; InputStream objIS = c . getResourceAsStream ( resourceName ) ; // debug //    InputStream debugIS = c.getResourceAsStream(fileName); //  System.out.println("Resource stream= "+fileName); //thredds.util.IO.copy(debugIS, System.out); if ( primIS == null ) { //System.out.println("classLoader="+new XMLStore().getClass().getClassLoader()); throw new java . io . IOException ( "XMLStore.createFromResource cant find <" + resourceName + ">" ) ; } if ( debugWhichStore ) System . out . println ( "XMLStore read from resource " + resourceName ) ; return new XMLStore ( primIS , objIS , storedDefaults ) ; }
Create a read-only XMLStore reading from the specified resource, opened as a Resource stream using the
XMLStore ClassLoader. This allows you to find files that are in jar files on
the application CLASSPATH.

@param resourceName The XMLStore is stored in this resource. By convention it has .xml suffix.
@param storedDefaults This contains the "stored defaults", or null if none.
@throws java.io.IOException if Resource not found or error reading it
@return new XMLStore object
Create a read - only XMLStore reading from the specified resource opened as a Resource stream using the XMLStore ClassLoader . This allows you to find files that are in jar files on the application CLASSPATH .