List of utility methods to do Properties Load from File
Properties | load(boolean loadAsResourceBundle, String name, ClassLoader loader) load if (name == null) { throw new IllegalArgumentException("null input: name"); if (name.startsWith("/")) { name = name.substring(1); Properties result = null; InputStream in = null; ... |
void | load(Class type, String resource, Properties map) load load(type, resource, map, true); |
Properties | load(Class> cls) Load a Properties object for a specific class. Properties properties; try (InputStream stream = cls.getResourceAsStream(cls.getSimpleName() + ".properties")) { if (stream == null) { throw new FileNotFoundException("Resource not found for class: " + cls.getName()); properties = new Properties(); properties.load(stream); return properties; |
Properties | load(File f) load Properties p = new Properties(); load(p, f); return p; |
Properties | load(File file) Loads Properties from a given File . Properties properties = new Properties(); if (file.isFile()) { FileReader fr = new FileReader(file); try { properties.load(fr); } catch (IOException ex) { fr.close(); throw ex; ... |
Properties | load(File file) load return load(file, null);
|
Map | load(File file) Loads a Map from a File assuming strings as keys and values. FileInputStream stream = null; try { stream = new FileInputStream(file); return load(stream); } finally { closeIfNotNull(stream); |
Properties | load(File file) Loads the specified properties file into memory Properties props = new Properties(); props.load(new FileReader(file)); return props; |
String | load(File file) Tries to load the file and return its content. StringBuffer result; BufferedReader reader; String line; String newLine; result = new StringBuffer(); newLine = System.getProperty("line.separator"); reader = null; try { ... |
void | load(File file, Properties data) Loads a properties file from file .
if (null != file && file.exists()) { FileReader fr = null; try { fr = new FileReader(file); data.load(fr); } finally { if (null != fr) { fr.close(); ... |