You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2004/05/08 22:03:34 UTC
cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider AbstractFileObject.java
imario 2004/05/08 13:03:34
Modified: vfs/src/java/org/apache/commons/vfs/provider
AbstractFileObject.java
Log:
handle lastmodtime in moveTo if file is copied instead of renamed
Revision Changes Path
1.38 +8 -2 jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Index: AbstractFileObject.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- AbstractFileObject.java 8 May 2004 19:48:30 -0000 1.37
+++ AbstractFileObject.java 8 May 2004 20:03:34 -0000 1.38
@@ -801,6 +801,13 @@
// different fs - do the copy/delete stuff
destFile.copyFrom(this, Selectors.SELECT_SELF);
+
+ if (destFile.getFileSystem().hasCapability(Capability.SET_LAST_MODIFIED) &&
+ getFileSystem().hasCapability(Capability.GET_LAST_MODIFIED))
+ {
+ destFile.getContent().setLastModifiedTime(this.getContent().getLastModifiedTime());
+ }
+
deleteSelf();
}
@@ -812,9 +819,8 @@
*
* @param newfile the new filename
* @return true if rename is possible
- * @throws FileSystemException
*/
- protected boolean canRenameTo(FileObject newfile) throws FileSystemException
+ public boolean canRenameTo(FileObject newfile)
{
if (getFileSystem() == newfile.getFileSystem())
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org