/** * 加载Properties文件 * * @param file * @return */ public static final Properties loadPropertiesFromFile(final File file) { if (file == null) { return null; } Properties properties = new Properties(); try { InputStream in = LSystem.read(file); loadProperties(properties, in, file.getName()); in.close(); } catch (IOException e) { e.printStackTrace(); } return properties; }
/** * 加载Properties文件 * * @param file */ public static final void loadPropertiesFileToSystem(final File file) { Properties properties = System.getProperties(); InputStream in = LSystem.read(file); loadProperties(properties, in, file.getName()); }