commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27615] New: - [IO] Last modified date not preserved in FileUtils.copyFile()
Date Thu, 11 Mar 2004 19:47:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27615>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27615

[IO] Last modified date not preserved in FileUtils.copyFile()

           Summary: [IO] Last modified date not preserved in
                    FileUtils.copyFile()
           Product: Commons
           Version: 1.0 Alpha
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Sandbox
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: craig@maine.com


File copying using FileUtils.copyFile() does not preserve the last modified 
date in the copy. I'm not sure about other OS's, but preservation of the last 
modified date occurs when copying from Windows Explorer or the command window 
in a Windows environment. To add this feature to the class, just add the 
following line at the end of FileUtils.copyFile():
      destination.setLastModified(source.lastModified());
To unit test this change, add the following to the end of 
FileUtilsTestCase.testCopyFile1() and/or testCopyFile2():
        assertTrue("Check last modified date preserved", testFile1.lastModified
() == destination.lastModified());

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message