List of utility methods to do Properties Load from File
Properties | loadBuildProperties(File projectRootDir) load Build Properties File file = new File(projectRootDir, "build.properties"); Properties buildProperties = new Properties(); if (file.canRead()) { InputStream is = null; try { try { is = new FileInputStream(file); buildProperties.load(is); ... |
int | loadCfg(String url) Description:TODO Properties prop = new Properties(); InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(url); try { prop.load(in); DRIVER = prop.get("jdbc.driverClassName").toString(); URL = prop.get("jdbc.url").toString(); USERNAME = prop.get("jdbc.username").toString(); PASSWORD = prop.get("jdbc.password").toString(); ... |
Properties | loadConfig(File settingsFile) load Config Properties loadedProperties = new Properties(); if (settingsFile.exists()) { FileInputStream settingsIn = new FileInputStream(settingsFile); loadedProperties.load(settingsIn); settingsIn.close(); return loadedProperties; |
Properties | loadConfigByPath(String path) load Config By Path FileInputStream fi = new FileInputStream(path); return loadProperty(fi); |
void | loadConfigProperties() reads values from config property file Properties properties = new Properties(); InputStream inputStream = null; try { File file = new File((new File(".")).getCanonicalPath() + File.separator + "resources" + File.separator + "config.properties"); if (file.exists()) { inputStream = new FileInputStream(file); } else { ... |
Properties | loadConfigProperties() reads values from config property file Properties properties = new Properties(); InputStream inputStream = null; try { File file = new File((new File(".")).getCanonicalPath() + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + "config.properties"); if (file.exists()) { inputStream = new FileInputStream(file); } else { ... |
void | loadConfiguration() load Configuration Properties properties = new Properties(); FileInputStream freader = new FileInputStream(PROPERTIES_FILE_NAME); properties.load(freader); userEndpointURL = properties.getProperty(PROPERTY_NAME_USER_ENDPOINT_URL); groupEndpointURL = properties.getProperty(PROPERTY_NAME_GROUP_ENDPOINT_URL); userName = properties.getProperty(PROPERTY_NAME_USER_NAME); password = properties.getProperty(PROPERTY_NAME_PASSWORD); String isOAuth = properties.getProperty(PROPERTY_NAME_ENABLE_OAUTH); ... |
void | loadConfiguration(String file) Load a Java properties file into the system properties. Properties p = new Properties(); FileInputStream in = new FileInputStream(file); p.load(in); in.close(); for (Iterator i = p.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); System.setProperty(key, p.getProperty(key)); |
Dictionary | loadConfiguration(String filePath) load Configuration File file = new File(filePath); FileInputStream stream = new FileInputStream(file); Properties p = new Properties(); try { p.load(stream); } finally { if (stream != null) stream.close(); ... |
void | loadCredentials(File credentials, String credentialsAppend) load Credentials InputStream propertiesFileStream = new FileInputStream(credentials); if (propertiesFileStream == null) { throw new IOException("Credentials stream is invalid."); Properties prop = new Properties(); prop.load(propertiesFileStream); if (prop.containsKey("user.name" + credentialsAppend)) { username = prop.getProperty("user.name" + credentialsAppend); ... |