IO 패키지
→
java.io
→
FileReader
, FileWriter
, FileInputStream
, FileOutputStream
NIO 패키지
→
java.nio.file
→ Path - represents the path to actual file or directory you are willing to work
→ Paths - Path의 유틸리티 클래스

sample code
Path p = Paths.get("D:\\path\\to\\new\\dir"); Path path = Files.createDicrectory(p);
Path path = Paths.get("DataSet/empty-poem.txt"); Path donePath = Files.createFile(path);
Path path = Paths.get("DataSet/poem.txt"); Path donePath = Files.createFile(path); String poem = "하늘을 우러러\n 한점 부끄럼 없거늘\n..."; Files.write(donePath, poem.getBytes(StandardCharsets.UTF_8));
Path path = Paths.get("DataSet/poem.txt"); List<String> lines = Files.readAllLines(path);