Java Properties Load from File load(String fileName)

Here you can find the source of load(String fileName)

Description

load

License

Open Source License

Declaration

public static Properties load(String fileName) 

Method Source Code


//package com.java2s;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Main {
    public static Properties load(String fileName) {

        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
        return load(is);
    }//from  ww w . ja v a  2s  .  com

    public static Properties load(InputStream is) {

        Properties properties = new Properties();
        try {
            properties.load(is);
        } catch (IOException e) {
            e.printStackTrace();
            throw new IllegalArgumentException(e.getMessage());
        }
        return properties;
    }
}

Related

  1. load(String fileName)
  2. load(String filename)
  3. load(String fileName)
  4. load(String filename)
  5. load(String filename)
  6. load(String path)
  7. load(String propertiesString)
  8. load(String resource)
  9. load(String resource)