//하위 디렉토리 및 파일 삭제
Files.walkFileTree(f.toPath(), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult postVisitDirectory(Path dir,
IOException exc) throws IOException {
Files.delete(dir);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file,
BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
}
});
'java' 카테고리의 다른 글
excel파일을 java에서 읽을때 한글깨지는 경우 excel파일 확인 (2) | 2016.03.09 |
---|---|
이클립스 SVN 계정 설정 삭제 (0) | 2015.12.23 |
List 중복제거 (0) | 2015.11.03 |
이클립스 jsp 오류시 jsp파일 바로 확인하기 (0) | 2015.10.28 |
시작일과 종료일 사이이 모든 날짜 구하기 (0) | 2015.10.23 |