package sample;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class DeleteExample {
public static void main(String[] args) throws Exception {
Path target = Paths.get("temp/bar/note.txt");
if (Files.exists(target)) {
Files.deleteIfExists(target);
}
}
}
Run
once again, Run