public static Properties readPropertyFile(String propertyFile) throws Exception {
  Properties properties=null;
  try {
    BufferedReader br=new BufferedReader(new FileReader(propertyFile));
    properties=new Properties();
    String str;
    while ((str=br.readLine()) != null) {
      str=str.trim();
      if ((!str.startsWith("#")) && (str.length() > 0)) {
        int indexOf=str.indexOf("=");
        int length=str.length();
        String propertyName=str.substring(0,indexOf);
        String value="";
        int valueStart=indexOf + 1;
        if (valueStart == length) {
          value="";
        }
 else {
          value=str.substring(valueStart,length);
        }
        properties.setProperty(propertyName,value);
      }
    }
  }
 catch (  Throwable t) {
    throw new Exception("Unable to load property file" + propertyFile,t);
  }
  return properties;
}

public static Properties readPropertyFile ( String propertyFile ) throws Exception { Properties properties = null ; try { BufferedReader br = new BufferedReader ( new FileReader ( propertyFile ) ) ; properties = new Properties ( ) ; String str ; while ( ( str = br . readLine ( ) ) != null ) { str = str . trim ( ) ; if ( ( ! str . startsWith ( "#" ) ) && ( str . length ( ) > 0 ) ) { int indexOf = str . indexOf ( "=" ) ; int length = str . length ( ) ; String propertyName = str . substring ( 0 , indexOf ) ; String value = "" ; int valueStart = indexOf + 1 ; if ( valueStart == length ) { value = "" ; } else { value = str . substring ( valueStart , length ) ; } properties . setProperty ( propertyName , value ) ; } } } catch ( Throwable t ) { throw new Exception ( "Unable to load property file" + propertyFile , t ) ; } return properties ; }
loads a property file that in name = value . this is used rather then using the properties . load ( inputstream instream ) to allow paths on windows to be loaded without having to add \ \ for paths .
