code: public static void readPropertiesFromResource(Properties properties,
              Class<?> classObj, String resourceName) throws IOException {
          if (classObj == null) {
              throw new IllegalArgumentException("classObj cannot be null");
          }
          if (resourceName != null) {
              InputStream inputStream = classObj.getResourceAsStream(resourceName);
              if (inputStream != null) {
                  try {
                      properties.load(inputStream);
                  } finally {
                      inputStream.close();
                  }
              } else {
                  throw new IOException(resourceName + " not found.");
              }
          }
      }
docs: Loads properties from the given resource into the given properties
  object.
  
  @param properties the {@link Properties}, using the given class'
  <code>getResourceAsStream</code> method.
  @param classObj the {@link Class} whose <code>getResourceAsStream</code>
  method is called, cannot be <code>null</code>.
  @param resourceName a resource {@link String}, visible * * from
  <code>classObj</code>'s class loader. If <code>null</code>, this method
  does nothing.
  @throws IOException if an error occurred reading the resource.