Java Properties Load from File loadProperties(File f)

Here you can find the source of loadProperties(File f)

Description

Load properties from the given file.

License

fedora commons license

Declaration

public static Properties loadProperties(File f) throws IOException 

Method Source Code


//package com.java2s;
/* The contents of this file are subject to the license and copyright terms
 * detailed in the license directory at the root of the source tree (also
 * available online at http://fedora-commons.org/license/).
 *///from   www . j a v  a 2 s  .co m

import java.io.File;

import java.io.FileInputStream;

import java.io.IOException;

import java.util.Properties;

public class Main {
    /**
     * Load properties from the given file.
     */
    public static Properties loadProperties(File f) throws IOException {
        Properties props = new Properties();
        FileInputStream in = new FileInputStream(f);
        try {
            props.load(in);
            return props;
        } finally {
            try {
                in.close();
            } catch (IOException e) {
            }
        }
    }
}

Related

  1. loadOSDependentLibrary()
  2. loadParamFromFile(String fileName, String param, String defValue)
  3. loadParams(String fileName)
  4. loadPriority()
  5. loadProperties(File directory, String propertiesFileName)
  6. loadProperties(File file)
  7. loadProperties(File file)
  8. loadProperties(File file)
  9. loadProperties(File file)