자바 File 클래스를 이용한 유용한 작업들

  • bbparkk
    (주말만기다려)
  • bbparkk's Avatar 이 글의 작성자
  • Offline
  • Newbie
  • Newbie
더보기
09 Jan 2017 19:39 #1688 작성자: bbparkk
bbparkk 님의 글: 자바 File 클래스를 이용한 유용한 작업들
1) Full Path 중 상위 Parent 까지만 추출

String fullFile = "/home/myHome/test.txt";
String parentPath = new File(fullFile).getParent();

2) Parent 디렉토리와 File 결합

String parentPath = "/home/myHome";
String fileName = "test.txt";
String fullPath = new File(parentPath, fileName).getPath();
Time to create page: 0.057 seconds
Powered by Kunena Forum