commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r452184 - in /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider: AbstractFileObject.java local/LocalFile.java
Date Mon, 02 Oct 2006 19:51:03 GMT
Author: imario
Date: Mon Oct  2 12:51:02 2006
New Revision: 452184

URL: http://svn.apache.org/viewvc?view=rev&rev=452184
Log:
VFS-82: fixed CCE

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java?view=diff&rev=452184&r1=452183&r2=452184
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Mon Oct  2 12:51:02 2006
@@ -745,7 +745,7 @@
         final int count = files.size();
         for (int i = 0; i < count; i++)
         {
-            final AbstractFileObject file = (AbstractFileObject) files.get(i);
+            final AbstractFileObject file = FileObjectUtils.getAbstractFileObject((FileObject)
files.get(i));
             // file.attach();
 
             // If the file is a folder, make sure all its children have been deleted
@@ -936,7 +936,7 @@
                 attach();
                 doRename(destFile);
 
-                ((AbstractFileObject) destFile).handleCreate(getType());
+                (FileObjectUtils.getAbstractFileObject(destFile)).handleCreate(getType());
 
                 destFile.close(); // now the destFile is no longer imaginary. force reattach.
 

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java?view=diff&rev=452184&r1=452183&r2=452184
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java
Mon Oct  2 12:51:02 2006
@@ -133,9 +133,11 @@
     /**
      * rename this file
      */
-    protected void doRename(FileObject newfile) throws Exception
+    protected void doRename(final FileObject newfile) throws Exception
     {
-        if (!file.renameTo(((LocalFile) newfile).getLocalFile()))
+        LocalFile newLocalFile = (LocalFile) FileObjectUtils.getAbstractFileObject(newfile);
+
+        if (!file.renameTo(newLocalFile.getLocalFile()))
         {
             throw new FileSystemException("vfs.provider.local/rename-file.error",
                 new String[]{file.toString(), newfile.toString()});



---------------------------------------------------------------------
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