Skip to content

Instantly share code, notes, and snippets.

@adam-arold
Created September 11, 2017 16:35
Show Gist options
  • Save adam-arold/d51b2eb08d5be1908e93c2daf69b78a4 to your computer and use it in GitHub Desktop.
Save adam-arold/d51b2eb08d5be1908e93c2daf69b78a4 to your computer and use it in GitHub Desktop.
JavaLineLoader
public class JavaLineLoader {
public List<String> loadLines(String path) {
List<String> lines = new ArrayList<>();
try(BufferedReader br = new BufferedReader(new FileReader(path))) {
String line;
while((line = br.readLine()) != null) {
lines.add(line);
}
} catch (IOException e) {
e.printStackTrace();
}
return lines;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment