250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- spring
- 정규표현식
- Chunk
- regex
- try catch
- upgrade
- expire_logs_days
- migration
- npm
- Express
- mysql 5.5
- git
- MySQL
- update
- nodejs
- Spring Batch
- REACT
- eslint
- REACTJS
- Node
- 퀵소트
- Effective Java
- log_bin
- JavaScript
- java
- log4j2
- Effective Java 3/e
- Regular expression
- current_date
- spring cloud
Archives
- Today
- Total
내 세상
[Spring] 하위 디렉토리/ 폴더 한번에 삭제 하기 본문
728x90
반응형
public void deleteFolder(String path) {
File folder = new File(path);
try {
if (folder.exists()) {
File[] folder_list = folder.listFiles();
for (int i = 0; i < folder_list.length; i++) {
if (folder_list[i].isFile()) {
folder_list[i].delete();
} else {
deleteFolder(folder_list[i].getPath());
}
folder_list[i].delete();
}
folder.delete();
}
} catch (Exception e) {
e.getStackTrace();
}
}
728x90
반응형
'Technical > Spring' 카테고리의 다른 글
[Spring] ResponseEntity / File Download 구현 (0) | 2021.07.02 |
---|---|
[Spring] URL Shorten 서비스 개발 (0) | 2021.06.23 |
[Spring] 전역 변수 사용하기 (0) | 2020.08.28 |
[Spring] CORS를 조져보자 -- TBD (0) | 2020.08.24 |
[MyBatis] Error - java.sql.SQLException: Illegal hour value '26' for java.sql.Time type in value '26:00:01 (0) | 2020.08.24 |