Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Main {
- public static void main(String[] args) {
- File f = new File("/Users/josiftepegjozov/Documents/test");
- File[] files = f.listFiles();
- for(int i = 0; i < files.length; i++) {
- if(files[i].toString().endsWith("rtf")) {
- if(files[i].delete()) {
- System.out.println("sucess");
- }
- else {
- System.out.println("fail");
- }
- }
- }
- }
- }
- // rec(folder: test)
- // rec(folder: test2)
- // rec(folder: test3)
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement