File 썸네일형 리스트형 spring java 파일 삭제 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.io.File; public class FileDeletionExample { public static void main(String[] args) { // 삭제할 파일 경로 String filePath = "C:\\example\\file.txt"; // File 객체 생성 File file = new File(filePath); // 파일이 존재하는지 확인 if (file.exists()) { // 파일 삭제 file.delete(); System.out.println("파일이 삭제되었습니다."); } else { System.out.println("파일이 존재하지 않습니다."); } } .. 더보기 이전 1 다음