@Test public void testLoadProperties() throws Exception { PropertyLoader.loadProperties("home","no file!"); }
public static void loadProperties(String filePath, String noExistWarn) { try { InputStream propFileStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (propFileStream != null) System.getProperties().load(propFileStream); else { System.out.println(noExistWarn); } } catch (IOException e) { System.out.println("Read properties file error:" + e.getMessage() + "!"); } }
PropertyLoader { public static void loadProperties(String filePath, String noExistWarn) { try { InputStream propFileStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (propFileStream != null) System.getProperties().load(propFileStream); else { System.out.println(noExistWarn); } } catch (IOException e) { System.out.println("Read properties file error:" + e.getMessage() + "!"); } } }
PropertyLoader { public static void loadProperties(String filePath, String noExistWarn) { try { InputStream propFileStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (propFileStream != null) System.getProperties().load(propFileStream); else { System.out.println(noExistWarn); } } catch (IOException e) { System.out.println("Read properties file error:" + e.getMessage() + "!"); } }  }
PropertyLoader { public static void loadProperties(String filePath, String noExistWarn) { try { InputStream propFileStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (propFileStream != null) System.getProperties().load(propFileStream); else { System.out.println(noExistWarn); } } catch (IOException e) { System.out.println("Read properties file error:" + e.getMessage() + "!"); } }  static void loadProperties(String filePath, String noExistWarn); static List<String> readLines(String filePath, String noExistWarn); }
PropertyLoader { public static void loadProperties(String filePath, String noExistWarn) { try { InputStream propFileStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (propFileStream != null) System.getProperties().load(propFileStream); else { System.out.println(noExistWarn); } } catch (IOException e) { System.out.println("Read properties file error:" + e.getMessage() + "!"); } }  static void loadProperties(String filePath, String noExistWarn); static List<String> readLines(String filePath, String noExistWarn);  }