Java Path File Read nio readLinesOfFile(String path)

Here you can find the source of readLinesOfFile(String path)

Description

read Lines Of File

License

Open Source License

Declaration

public static List<String> readLinesOfFile(String path) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import java.util.List;

public class Main {
    public static List<String> readLinesOfFile(String path) throws IOException {
        Path pathToFile = Paths.get(path);
        return Files.readAllLines(pathToFile, StandardCharsets.US_ASCII);
    }//from  ww  w .j  av  a  2s. c  o  m
}

Related

  1. readLineByLine(String filePath)
  2. readLines(Path path, boolean ignoreComments)
  3. readLineS(String filePath, int line)
  4. readLinesFromFile(Path path)
  5. readLinesFromFileLazy(String path)
  6. readLineSP(String filePath, int line, int pos)
  7. readLinesToString(Path file)
  8. readManifest(Path path)
  9. readPropertiesFile(Path path)