List of utility methods to do Properties Load from File
Properties | loadProperties(String propertyPath) Load the properties found in the class path and merge them to the system properties in a way that the system properties supersede the properties found in the class path. Properties p = new Properties(); InputStream propsFileStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream(propertyPath); if (propsFileStream == null) throw new FileNotFoundException(propertyPath); p.load(propsFileStream); Enumeration e = System.getProperties().keys(); while (e.hasMoreElements()) { ... |
Properties | loadProperties(String propsFile) Creates a new Properties object from the properties file located at the argument location Properties ret = new Properties(); try { File test = new File(propsFile); if (!test.exists()) { RuntimeException re = new RuntimeException("Could not find the properties file: " + propsFile); throw re; InputStream in = new FileInputStream(propsFile); ... |
Properties | loadProperties(String sFile) Me-load file properties Properties p = new Properties(); try { FileInputStream in = new FileInputStream(sFile); p.load(in); in.close(); } catch (IOException ex) { System.out.println(ex.getMessage()); return p; |
Properties | loadPropertiesFile(File file, boolean critical) load Properties File Properties configProps = new Properties(); InputStream is = null; try { is = new FileInputStream(file); configProps.load(is); } catch (FileNotFoundException ex) { if (critical) { throw ex; ... |
Properties | loadPropertiesFile(final File file) Loads the given file as a Properties file. FileInputStream in = new FileInputStream(file); try { final Properties rv = new Properties(); rv.load(in); return rv; } finally { in.close(); |
Properties | loadPropertiesFile(String fileName) Load properties file. Properties props = new Properties(); FileInputStream is = null; try { is = new FileInputStream(fileName); props.load(is); } catch (IOException e) { return null; } finally { ... |
Properties | loadPropertiesFile(String fileName) load Properties File Properties properties = new Properties(); InputStream input = null; try { input = new FileInputStream(fileName); properties.load(input); return properties; } finally { if (input != null) { ... |
Properties | loadPropertiesFile(String filePath) Methode de chargement d'un fichier de proprietes if (filePath == null || filePath.trim().isEmpty()) throw new RuntimeException( "Erreur lors du chargement du fichier de proprietes: Le chemin du fichier n'est pas renseigne"); String completeFilePath = filePath.trim(); InputStream stream = null; try { stream = new FileInputStream(completeFilePath); } catch (FileNotFoundException e) { ... |
Properties | loadPropertiesFile(String filePath) load Properties File Properties properties = new Properties(); InputStream is = null; try { try { is = new FileInputStream(filePath); properties.load(is); } finally { if (is != null) { ... |
Properties | loadPropertiesFile(String path) load Properties File Properties properties = new Properties(); try (BufferedReader reader = new BufferedReader(new FileReader(path))) { properties.load(reader); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); return properties; |