Here you can find the source of readLines(File inputFile)
Parameter | Description |
---|---|
inputFile | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static List<String> readLines(File inputFile) throws Exception
//package com.java2s; //License from project: Apache License import java.io.File; import java.nio.charset.Charset; import java.nio.file.Files; import java.util.List; public class Main { /**/*w ww .j ava2s .co m*/ * read lines from the given inputFile * @param inputFile * @return a list of Strings * @throws Exception */ public static List<String> readLines(File inputFile) throws Exception { List<String> list = Files.readAllLines(inputFile.toPath(), Charset.defaultCharset()); return list; } }