Java Properties Load from File loadPropertiesFromClasspath(Class loadResourceClass, String classpath)

Here you can find the source of loadPropertiesFromClasspath(Class loadResourceClass, String classpath)

Description

load Properties From Classpath

License

Apache License

Declaration

public static Properties loadPropertiesFromClasspath(Class loadResourceClass, String classpath)
            throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.InputStream;

import java.util.Properties;

public class Main {
    public static Properties loadPropertiesFromClasspath(Class loadResourceClass, String classpath)
            throws Exception {
        //get the build number
        Properties aprops = new Properties();
        InputStream ios = loadResourceClass.getResource(classpath).openStream();
        aprops.load(ios);/*from w  ww.  ja va2 s .  c o  m*/
        return aprops;

    }
}

Related

  1. loadPropertiesFile(String path)
  2. loadPropertiesFile(String propertiesFileName)
  3. loadPropertiesFile(String propFile)
  4. loadPropertiesFile(String propFilePath)
  5. loadPropertiesFromClasspath( final String filename)
  6. loadPropertiesFromClasspath(String pfname)
  7. loadPropertiesFromFile(Class clazz, String filePath)
  8. loadPropertiesFromFile(JarFile jar)
  9. loadPropertiesFromFile(String configFile)