没用过java.io.file这个包吗? 要实行并不难,代码就不帮你写了, 自己去查java api 中java.io.file包以下方法public String[] list() Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname.public File[] listFiles() Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
getServletContext().getRealPath("\\")
就可以得到good luck
要实行并不难,代码就不帮你写了,
自己去查java api 中java.io.file包以下方法public String[] list()
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname.public File[] listFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
先用我刚才说的那个
getServletContext().getRealPath("\\")
得到路径
再用
FilenameFilter配合File取得所有文件最后,可以用File对象的delete方法删除之,或做其它的操作good luck