Java Properties Load from File loadPropertiesFromFile(String pathname)

Here you can find the source of loadPropertiesFromFile(String pathname)

Description

load Properties From File

License

Open Source License

Declaration

protected static Properties loadPropertiesFromFile(String pathname)
            throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.FileInputStream;

import java.io.IOException;

import java.util.Properties;

public class Main {
    protected static Properties loadPropertiesFromFile(String pathname)
            throws IOException {

        Properties properties = new Properties();
        if (pathname == null || pathname.length() == 0)
            return properties;

        FileInputStream in = null;
        in = new FileInputStream(pathname);

        if (in != null) {
            properties.load(in);/*from   w  w  w .j  a  va  2 s.co m*/
            in.close();
        }

        return properties;
    }
}

Related

  1. loadPropertiesFromFile(Class clazz, String filePath)
  2. loadPropertiesFromFile(JarFile jar)
  3. loadPropertiesFromFile(String configFile)
  4. loadPropertiesFromFile(String filePath)
  5. loadPropertiesFromFile(String fullFileName)
  6. loadPropertiesFromPath(String propsFilePath)
  7. loadPropertiesInClassPath(String propertiesFileName)
  8. loadProvidersConfiguration(Class base, String confPropertiesName)
  9. loadPythonScript(String pythonScriptName)