public static String readValueFromFile(File file,String key) throws IOException {
  String value=null;
  if (file.exists()) {
    Properties prop=new Properties();
    FileReader reader=new FileReader(file);
    prop.load(reader);
    reader.close();
    value=prop.getProperty(key);
    log.info("The value of property with key({}) is: {}",key,value);
    return value;
  }
  log.info("File({}) doesn't exist",file.getAbsoluteFile());
  return null;
}

public static String readValueFromFile ( File file , String key ) throws IOException { String value = null ; if ( file . exists ( ) ) { Properties prop = new Properties ( ) ; FileReader reader = new FileReader ( file ) ; prop . load ( reader ) ; reader . close ( ) ; value = prop . getProperty ( key ) ; log . info ( "The value of property with key({}) is: {}" , key , value ) ; return value ; } log . info ( "File({}) doesn't exist" , file . getAbsoluteFile ( ) ) ; return null ; }
get the value of property with specific key
