List of utility methods to do Properties Read
Properties | getProperties(String propsFile) get Properties return getProperties(propsFile, false);
|
Properties | getProperties(String propsFile) get Properties return getProperties(propsFile, false);
|
Properties | getProperties(String propsFile, boolean addToSystemProps) get Properties FileInputStream fis = null; Properties props = null; try { fis = new FileInputStream(propsFile); props = addToSystemProps ? new Properties( System.getProperties()) : new Properties(); props.load(fis); fis.close(); ... |
Properties | getProperties(String propsFile, boolean addToSystemProps) get Properties FileInputStream fis = null; Properties props = null; try { fis = new FileInputStream(propsFile); props = addToSystemProps ? new Properties( System.getProperties()) : new Properties(); props.load(fis); fis.close(); ... |
Map | loadPropertiyFile(String file) load Propertiy File File f = new File(file); Properties pro = new Properties(); if (f.exists()) { try { FileInputStream in = new FileInputStream(f); pro.load(in); } catch (IOException e) { System.out.println("loadPropertyFile() - error: " ... |
String | propertiesToString(Properties p) properties To String StringBuffer sb = new StringBuffer(); Enumeration enu = p.propertyNames(); while (enu.hasMoreElements()) { String key = (String) enu.nextElement(); sb.append(key); sb.append("="); sb.append(p.getProperty(key)); sb.append("\n"); ... |
Properties | readPropertyFile(String filePath) Read properties file. Properties properties = new Properties(); Reader reader = null; try { reader = FileUtil.readFileReader(filePath); properties.load(reader); return properties; } finally { IOUtil.closeReader(reader); ... |
Properties | toProperties(String fileName) to Properties try { return toProperties(new FileInputStream(fileName)); } catch (IOException ioe) { return new Properties(); |
String | findBuildPropValueOf(String prop) find Build Prop Value Of String mBuildPath = "/system/build.prop"; String DISABLE = "disable"; String value = null; try { Properties mProps = new Properties(); mProps.load(new FileInputStream(mBuildPath)); value = mProps.getProperty(prop, DISABLE); Log.d("TAG", ... |
String | findBuildPropValueOf(String prop) find Build Prop Value Of String mBuildPath = "/system/build.prop"; String DISABLE = "disable"; String value = null; try { Properties mProps = new Properties(); mProps.load(new FileInputStream(mBuildPath)); value = mProps.getProperty(prop, DISABLE); Log.d(TAG, ... |