code: public static Properties getResourceAsProperties(Class<?> requestingClass, String resource)
              throws ResourceMissingException, IOException {
          InputStream inputStream = null;
          Properties props = null;
          try {
              inputStream = getResourceAsStream(requestingClass, resource);
              props = new Properties();
              props.load(inputStream);
          } finally {
              if (inputStream != null) inputStream.close();
          }
          return props;
      }
docs: Get the contents of a URL as a java.util.Properties object
  
  @param requestingClass the java.lang.Class object of the class that is attempting to load the
  resource
  @param resource a String describing the full or partial URL of the resource whose contents to
  load
  @return the actual contents of the resource as a Properties object
  @throws ResourceMissingException
  @throws java.io.IOException