Skip to content

Instantly share code, notes, and snippets.

@djuniorscjr
Last active September 4, 2016 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djuniorscjr/d34fe175faeb1a183f8c99acd97ffae7 to your computer and use it in GitHub Desktop.
Save djuniorscjr/d34fe175faeb1a183f8c99acd97ffae7 to your computer and use it in GitHub Desktop.
Example read file using java 8
final String relativePath = PATH_ARQUIVO.CSV;
final ClassLoader classLoader = getClass().getClassLoader();
final InputStream resourceAsStream = classLoader.getResourceAsStream(relativePath);
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(resourceAsStream))) {
buffer.lines().collect(Collectors.toList()).forEach(line -> {
final String[] arrayBank = line.split(";");
String value = line[COLUNA_TIPO_MOEDA];
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment