public static File[] listFile(String path)
{
File f = null;
// 新建文件实例
f = new File(path);
// 此处获取文件夹下的所有文件
File[] list = f.listFiles();
return list;
}
public static void move(String frompath,String topath,String topathname)
{
// 如果目标文件夹不存在,创建新的日期文件夹
if (!(new File(topath).exists())) {
new File(topath).mkdir();
}
File from = new File(frompath);
File to = new File(topathname);
from.renameTo(to);
}
public static void main(String[] args)
{
File[] list=listFile("D:\\cert");
for (int i = 0; i < list.length; i++)
{
System.out.println(list[i].getAbsolutePath());
}
}