如何使用jsp(java)来实现某个文件夹的系统空间占用量!!
如题???
------解决方案--------------------String path = config.getServletContext().getRealPath( "/ ");
File file = new File(path);
File[] listFile = file.listFiles();
int i = 0;
int fileFileSize = 0;
for (; i < listFile.lentth; i++) {
out.println(listFile[i].length/1000 * 1000 + "m ");
}