forked from dominik1999w/ReminderApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileManager.java
More file actions
31 lines (28 loc) · 770 Bytes
/
Copy pathFileManager.java
File metadata and controls
31 lines (28 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package reminder;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
public class FileManager {
private String fileName;
public FileManager (String fileName){
this.fileName = fileName;
}
public List<String> readFileInList()
{
List<String> lines = Collections.emptyList();
try
{
lines =
Files.readAllLines(Paths.get(fileName), StandardCharsets.UTF_8);
}
catch (IOException e)
{
System.out.println("reading failed");
e.printStackTrace();
}
return lines;
}
}