//文件原地址
File oldFile = new File("c:/test.xls");
//文件新(目标)地址
String newPath = "c:/test/";
//new一个新文件夹
File fnewpath = new File(newPath);
//判断文件夹是否存在
if(!fnewpath.exists())
fnewpath.mkdirs();
//将文件移到新文件里
File fnew = new File(newPath +oldFile.getName());
oldFile.renameTo(fnew);

相关文章:

  • 2022-02-10
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2021-10-01
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案