Here you can find the source of loadProperties(String filename)
Parameter | Description |
---|---|
filename | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static Properties loadProperties(String filename) throws IOException
//package com.java2s; import java.io.*; import java.util.*; public class Main { /**// ww w . j a v a 2 s . co m * @param filename * @return * @throws IOException */ public static Properties loadProperties(String filename) throws IOException { return loadProperties(new File(filename)); } /** * @param file * @return * @throws IOException */ public static Properties loadProperties(File file) throws IOException { Properties properties = null; InputStream in = null; try { in = new FileInputStream(file); properties = new Properties(); properties.load(in); } finally { try { if (in != null) in.close(); } catch (IOException e) { } } return properties; } }