Java Properties Load from File load(Properties properties, String fileName)

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

Description

Load into the given properties the file from the given fileName.

License

Apache License

Parameter

Parameter Description
properties The properties object to load values from.
fileName The name of the properties file.

Declaration

private static void load(Properties properties, String fileName) 

Method Source Code


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

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class Main {
    /**/* ww  w. j  a v a2  s  .com*/
     * Load into the given <i>properties</i> the file from the given <i>fileName</i>.
     *
     * @param properties The properties object to load values from.
     * @param fileName   The name of the properties file.
     */
    private static void load(Properties properties, String fileName) {
        try {
            properties.load(new FileInputStream(fileName));
        } catch (IOException ignored) {
            throw new RuntimeException("Could not load " + fileName);
        }
    }
}

Related

  1. load(InputStream input)
  2. load(InputStream inputStream)
  3. load(InputStream is)
  4. load(InputStream stream)
  5. load(Map map, String fileName)
  6. load(Properties props, Collection filters, File basedir)
  7. load(Properties props, File f)
  8. load(Properties props, File file)
  9. load(Properties props, String filename)