Delete Java classes for all files in the specified directory

xiaoxiao2021-03-06  116

Public class Delfile {/ ** * Remove all files and directories in the specified directory * @Param filepath Need to delete file directory path * / public static void deLallFile (String filepath) {/ ** * Specify delete directory path to construct a file object * / File file = new file (filepath); file [] filelist = file.listfiles (); / ** * Initialization subdirectory path * / string DirPath = NULL; if (fileList! = Null) for (int i = 0; I

DELALLFILE (DirPath);}} / ** * Delete given root directory * / file.delete ();}}

转载请注明原文地址:https://www.9cbs.com/read-99129.html

New Post(0)