Java examples for Native OS:Shell Command
rm Dir shell command
//package com.java2s; import java.io.File; public class Main { public static void rmDir(String dirPath) { File mtpDir = new File(dirPath); for (File file : mtpDir.listFiles()) { System.out.println("Deleting " + file.getName()); file.delete();/* w ww. j a v a 2s . c om*/ } } }