- Keep the creation time of the file after copying
File oldFile = new File("E:\\test\\old.png");
File newFile = new File("E:\\test\\new.png");
FileCopyUtils.copy(oldFile,newFile);
Object creationTime = Files.getAttribute(Paths.get(oldFile.getAbsolutePath()), "creationTime");
Files.setAttribute(Paths.get(newFile.getAbsolutePath()), "creationTime", creationTime);