LogReadServiceImpl implements LogReadService { @Override @RemoteMethod public List<String> read_log(String log_name, int line) { try { List<String> lines = Files.readLines(new File(log_folder + File.separator + log_name + ".txt"), Charset.defaultCharset()); return lines.subList(line, lines.size()); } catch (IOException e) { e.printStackTrace(); } return null; }  void setLog_folder(String log_folder); @Override @RemoteMethod List<String> read_log(String log_name, int line); @Override @RemoteMethod String sayHello(String abc);  }
@Test public void testRead_log() throws Exception { LogReadServiceImpl logReadService = new LogReadServiceImpl(); logReadService.setLog_folder("/iflytek/temp"); List<String> contents = logReadService.read_log("jenkins-test", 199000); System.out.println(contents.size()); }