자바에서 폴더는 어떻게 만드나요?
조회수 2531회
1 답변
-
File theDir = new File("새 폴더"); // 해당 디렉토리가 없을경우 디렉토리를 생성한다. if (!theDir.exists()) { System.out.println("creating directory: " + directoryName); boolean result = false; try{ theDir.mkdir(); result = true; } catch(SecurityException se){ //handle it } if(result) { System.out.println("DIR created"); } }
이렇게 하시면 됩니다.
댓글 입력