Android Properties Read loadPropertiyFile(String file)

Here you can find the source of loadPropertiyFile(String file)

Description

load Propertiy File

Declaration

public static Map loadPropertiyFile(String file) 

Method Source Code

//package com.java2s;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;

public class Main {
    public static Map loadPropertiyFile(String file) {
        File f = new File(file);
        Properties pro = new Properties();

        if (f.exists()) {
            try {
                FileInputStream in = new FileInputStream(f);
                pro.load(in);//from  www  .  jav  a2  s.  co m
            } catch (IOException e) {
                System.out.println("loadPropertyFile() - error: "
                        + e.getMessage());
                e.printStackTrace();
            }
        } else {
            System.out.println("File not found! - " + file);
        }
        return pro;
    }
}

Related

  1. getProperties(String propsFile)
  2. getProperties(String propsFile)
  3. getProperties(String propsFile, boolean addToSystemProps)
  4. getProperties(String propsFile, boolean addToSystemProps)
  5. propertiesToString(Properties p)
  6. readPropertyFile(String filePath)
  7. toProperties(String fileName)
  8. findBuildPropValueOf(String prop)