code: public static Properties getPropertiesFromResource(final String name) throws Throwable {
      Properties pr = new Properties();
      InputStream is = null;
  
      try {
        try {
          // The jboss?? way - should work for others as well.
          ClassLoader cl = Thread.currentThread().getContextClassLoader();
          is = cl.getResourceAsStream(name);
        } catch (Throwable clt) {}
  
        if (is == null) {
          // Try another way
          is = Util.class.getResourceAsStream(name);
        }
  
        if (is == null) {
          throw new Exception("Unable to load properties file" + name);
        }
  
        pr.load(is);
  
        //if (debug) {
        //  pr.list(System.out);
        //  Logger.getLogger(Util.class).debug(
        //      "file.encoding=" + System.getProperty("file.encoding"));
        //}
        return pr;
      } finally {
        if (is != null) {
          try {
            is.close();
          } catch (Throwable t1) {}
        }
      }
    }
docs: Load a named resource as a Properties object
  
  @param name    String resource name
  @return Properties populated from the resource
  @throws Throwable