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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -