赞
踩
publicclassFlie{/***@paramargs*/publicstaticvoidmain(String[]args){Filefile=newFile("C:\\Users\\Administrator\\Desktop\\website\\WEB-INF\\upload");Stringtest[];test=file....
public class Flie {
/**
* @param args
*/
public static void main(String[] args) {
File file=new File("C:\\Users\\Administrator\\Desktop\\website\\WEB-INF\\upload");
String test[];
test=file.list();
File srcFile = new File("C:\\Users\\Administrator\\Desktop\\website\\WEB-INF\\upload"); //指定路径
boolean bFile = srcFile.exists();
if (!bFile || !srcFile.isDirectory() || !srcFile.canRead()) {
try {
srcFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}else{
File[] file1 = srcFile.listFiles();
for(int i=0;i
if(file1[i].getAbsolutePath().indexOf(".html")>-1)
{
System.out.println(test[i].replaceAll("[.][^.]+$", ""));
Calendar cal = Calendar.getInstance();
File f = file1[i].getAbsoluteFile();
long time = f.lastModified();
cal.setTimeInMillis(time);
System.out.println("修改时间: " + cal.getTime());}
}
}
}
怎么在JSP页面显示test[i].replaceAll(".html")>-1
帮帮忙吧大神们
展开
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。