Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Looks for an existing transcript and reads it into an array if found.
- * If the file doesn't exist it creates a new transcript.
- *
- * @param file File to read from
- * @throws IOException
- */
- public void readFile(File file) throws IOException {
- Charset charset = Charset.forName("utf-8");
- Arraylist<String> someList = new Arraylist<String>();
- try {
- BufferedReader reader = Files.newBufferedReader(Paths.get(file.getAbsolutePath()), charset);
- String line;
- while ((line = reader.readLine()) != null) {
- someList.put(line);
- }
- } catch (IOException x) {
- //File does not exist... not possible as user cannot select nothing from a fileChooser
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement