How use Java FileChannel to copy preserving timestamps -
how use java filechannel copy preserving timestamps files , directories? looks files not preserving timestamps while copying location. how possible using filechannel in java?
you can not filechannel
, can use apache commons io :
ioutils.copy(new fileinputstream(file), new fileoutputstream(file2)); // copy file , preserve time stamp. sourcefile , destfile of type java.io.file fileutils.copyfile(sourcefile,destfile);
reference : http://www.studytrails.com/java-io/file-copying-and-moving-deleting.jsp
Comments
Post a Comment