File文件改名字

if (templateDataset != null) {
			File[] file = templateDataset.getFiles("SF6_wpsXlsx", System.getProperty("java.io.tmpdir"));
			if (file != null) {
				SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
				String name = format.format(new Date())+"_"+file[0].getName();
				File newfile = new File(file[0].getParent()+File.separator+name);
				file[0].renameTo(newfile);
				return newfile;
			}
		}

你可能感兴趣的:(Teamcenter,rac,开发语言,后端,java)