Java Properties Load from InputStream loadProperties(final InputStream io)

Here you can find the source of loadProperties(final InputStream io)

Description

Loads properties from input stream.

License

Open Source License

Parameter

Parameter Description
io a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static void loadProperties(final InputStream io) throws IOException 

Method Source Code

//package com.java2s;
/*//from  w  w  w  .j av  a  2 s . c o  m
 * See COPYING for license information.
 */

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

public class Main {
    /**
     * A cache of the properties
     */
    private static Properties props = null;

    /**
     * Loads properties from input stream.
     *
     * @param io
     * @throws IOException
     */
    public static void loadProperties(final InputStream io) throws IOException {
        if (null == io) {
            throw new IllegalArgumentException("Input stream cannot be null.");
        }
        props = new Properties();
        props.load(io);
    }
}

Related

  1. loadProperties(Class aClass, String aFileName, InputStream aResourceAsStream)
  2. loadProperties(final InputStream in)
  3. loadProperties(final Properties properies, final InputStream inputStream)
  4. loadProperties(InputStream input)
  5. loadProperties(InputStream input)
  6. loadProperties(InputStream inputStream)