package CHAP12;

import java.nio.file.Path; // 파일 경로 관리를 위한 Path 인터페이스 가져오기
import java.nio.file.Paths; // 경로 객체 생성을 위한 Paths 클래스 가져오기

public class C13_13_PathExample { // 파일 경로 처리 예제 클래스
    public static void main(String[] args) {
        Path path1 = Paths.get("test.txt"); // 상대 경로로 파일 경로 객체 생성
        Path path2 = Paths.get("/home/user/test.txt"); // 절대 경로로 파일 경로 객체 생성

        System.out.println("파일 이름: " + path1.getFileName()); // 파일 이름 출력
        System.out.println("부모 디렉터리: " + path2.getParent()); // 부모 디렉터리 출력
        System.out.println("절대 경로 변환: " + path1.toAbsolutePath()); // 상대 경로를 절대 경로로 변환하여 출력
    }
}

