List of utility methods to do Properties Load from File
Properties | load(String filename) Loads a properties from a file name. Properties p = new Properties(); FileInputStream inStream = new FileInputStream(filename); p.load(inStream); inStream.close(); return p; |
Map | load(String filename) load if (!filename.endsWith("properties")) filename += ".properties"; InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename); return load(is); |
Properties | load(String fileName) load InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
return load(is);
|
Properties | load(String path) load Properties props = new Properties(); try { props.load(new FileInputStream(path)); } catch (FileNotFoundException e) { new RuntimeException("Error loading properties: " + path, e); } catch (IOException e) { new RuntimeException("Error loading properties: " + path, e); return props; |
Properties | load(String propertiesString) load Properties properties = new Properties(); if (propertiesString != null) properties.load(new StringReader(propertiesString)); return properties; |
Properties | load(String resource) load InputStream in = null; Properties prop = new Properties(); try { in = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); prop.load(in); } catch (Exception e) { e.printStackTrace(); if (in != null) { ... |
Map | load(String resource) Load properties from the given name resource. Properties p = new Properties(); try { InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); if (stream == null) { stream = new FileInputStream(resource); p.load(stream); } catch (Exception e) { ... |
Properties | load(String[] paths, String fileName) Load the specified properties file from one of the specified set of paths. Properties properties = null; File propertiesFile = null; try { String path = null; for (int i = 0; i < paths.length; i++) { path = paths[i] + File.separator + fileName; propertiesFile = new File(path); if (propertiesFile.exists()) ... |
Properties | loadAccessTokenProperties(InputStream inputStream) load Access Token Properties Properties properties = new Properties(); try { properties.load(inputStream); } catch (IOException ioException) { return properties; |
Properties | loadApiProperties(InputStream inputStream) load Api Properties Properties properties = new Properties(); properties.load(inputStream); return properties; |