|
|
|
@ -169,11 +169,16 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
|
|
|
|
|
private List<String> readPartFileContent(String filePath, |
|
|
|
|
int skipLine, |
|
|
|
|
int limit) { |
|
|
|
|
File file = new File(filePath); |
|
|
|
|
if (file.exists() && file.isFile()) { |
|
|
|
|
try (Stream<String> stream = Files.lines(Paths.get(filePath))) { |
|
|
|
|
return stream.skip(skipLine).limit(limit).collect(Collectors.toList()); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
logger.error("read file error",e); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
logger.info("file path: {} not exists", filePath); |
|
|
|
|
} |
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|