Properties

阅读更多
public static Properties getPropertiesFile () {
   File file = new File(filePath);

   if(file.exists() && !file.isDirectory()) {
      try (FileReader fr = new FileReader(file)) {
         props.load(fr);
         return props;
      } catch (Exception ioe) {
         ioe.printStackTrace();
      }
   } else {
      System.err.println("Missing .properties file.");
   }
   return null;
}

你可能感兴趣的:(Properties)