@Test public void testReadLines() throws Exception { PropertyLoader.readLines("home","no file!"); }
public static List<String> readLines(String filePath, String noExistWarn) { List<String> lines = new ArrayList<String>(); try { InputStream inputStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (inputStream != null) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = null; while ((line = bufferedReader.readLine()) != null) { lines.add(line); } }else { System.out.println(noExistWarn); } } catch (Exception e) { System.out.println("Read lines error:" + e.getMessage() + "!"); } return lines; }
PropertyLoader { public static List<String> readLines(String filePath, String noExistWarn) { List<String> lines = new ArrayList<String>(); try { InputStream inputStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (inputStream != null) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = null; while ((line = bufferedReader.readLine()) != null) { lines.add(line); } }else { System.out.println(noExistWarn); } } catch (Exception e) { System.out.println("Read lines error:" + e.getMessage() + "!"); } return lines; } }
PropertyLoader { public static List<String> readLines(String filePath, String noExistWarn) { List<String> lines = new ArrayList<String>(); try { InputStream inputStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (inputStream != null) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = null; while ((line = bufferedReader.readLine()) != null) { lines.add(line); } }else { System.out.println(noExistWarn); } } catch (Exception e) { System.out.println("Read lines error:" + e.getMessage() + "!"); } return lines; }  }
PropertyLoader { public static List<String> readLines(String filePath, String noExistWarn) { List<String> lines = new ArrayList<String>(); try { InputStream inputStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (inputStream != null) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = null; while ((line = bufferedReader.readLine()) != null) { lines.add(line); } }else { System.out.println(noExistWarn); } } catch (Exception e) { System.out.println("Read lines error:" + e.getMessage() + "!"); } return lines; }  static void loadProperties(String filePath, String noExistWarn); static List<String> readLines(String filePath, String noExistWarn); }
PropertyLoader { public static List<String> readLines(String filePath, String noExistWarn) { List<String> lines = new ArrayList<String>(); try { InputStream inputStream = PropertyLoader.class.getClass().getResourceAsStream(filePath); if (inputStream != null) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = null; while ((line = bufferedReader.readLine()) != null) { lines.add(line); } }else { System.out.println(noExistWarn); } } catch (Exception e) { System.out.println("Read lines error:" + e.getMessage() + "!"); } return lines; }  static void loadProperties(String filePath, String noExistWarn); static List<String> readLines(String filePath, String noExistWarn);  }