remove Files From Folder - Java File Path IO

Java examples for File Path IO:File delete

Description

remove Files From Folder

Demo Code


//package com.java2s;

import java.io.File;

public class Main {
    public static void removeFilesFromFolder(String folder) {
        File fold = new File(folder);
        for (int i = 0; i < fold.listFiles().length; i++) {
            fold.listFiles()[i].delete();
        }//  ww w  . j a  v a 2  s  .com
    }
}

Related Tutorials