Android Utililty Methods Properties Read

List of utility methods to do Properties Read

Description

The list of methods to do Properties Read are organized into topic(s).

Method

PropertiesgetProperties(String propsFile)
get Properties
return getProperties(propsFile, false);
PropertiesgetProperties(String propsFile)
get Properties
return getProperties(propsFile, false);
PropertiesgetProperties(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();
...
PropertiesgetProperties(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();
...
MaploadPropertiyFile(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: "
...
StringpropertiesToString(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");
...
PropertiesreadPropertyFile(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);
...
PropertiestoProperties(String fileName)
to Properties
try {
    return toProperties(new FileInputStream(fileName));
} catch (IOException ioe) {
    return new Properties();
StringfindBuildPropValueOf(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",
...
StringfindBuildPropValueOf(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,
...