Java Properties Load from InputStream loadProperties(InputStream inputStream)

Here you can find the source of loadProperties(InputStream inputStream)

Description

Read Properties from an InputStream.

License

Open Source License

Parameter

Parameter Description
inputStream InputStream to read Properties from

Return

Properties as read from inputStream

Declaration

public static Properties loadProperties(InputStream inputStream) 

Method Source Code


//package com.java2s;
import java.io.InputStream;

import java.util.Properties;

public class Main {
    /**/*w ww.  j a  va  2s.c o  m*/
     * Read Properties from an InputStream.
     *
     * @param inputStream InputStream to read Properties from
     * @return Properties as read from inputStream
     */
    public static Properties loadProperties(InputStream inputStream) {
        if (inputStream == null) {
            return null;
        }
        Properties properties = new Properties();
        try {
            properties.load(inputStream);
        } catch (Exception e) {
            throw new RuntimeException("Error loading properties from stream", e);
        }

        return properties;
    }
}

Related

  1. loadProperties(final InputStream in)
  2. loadProperties(final InputStream io)
  3. loadProperties(final Properties properies, final InputStream inputStream)
  4. loadProperties(InputStream input)
  5. loadProperties(InputStream input)
  6. loadProperties(InputStream inputStream)
  7. loadProperties(InputStream inputStream)
  8. loadProperties(InputStream inputStream, Properties result)
  9. loadProperties(InputStream stream)