Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String filePath = "path/to/file.txt";
- Path input = Paths.get(filePath);
- try (InputStream in = Files.newInputStream(input);
- BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
- String line = null;
- while ((line = reader.readLine()) != null) {
- LOG.info(line);
- }
- } catch (IOException e) {
- LOG.error("File not found", e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement