//创建文件
			SimpleDateFormat df = new SimpleDateFormat(template.getName()+"MM-dd HHmm");//设置日期格式
			String fileName = df.format(new Date())+".pptx";
			String fileUrl = "D:" + File.separator + "汽车人才对标管理平台" + File.separator + fileName;
			File testFile = new File(fileUrl);
			File fileParent = testFile.getParentFile();//返回的是File类型,可以调用exsit()等方法
			if (!fileParent.exists()) {
				fileParent.mkdirs();// 能创建多级目录
			}
			if (!testFile.exists())
				testFile.createNewFile();//有路径才能创建文件

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
相关资源
相似解决方案