[ http://issues.apache.org/jira/browse/VFS-22?page=all ]

Mario Ivankovits resolved VFS-22.
---------------------------------

    Resolution: Cannot Reproduce

Maybe some other change already fixed it.
If its still a problem, please drop me a note.

Thanks!

> [vfs] VFS is not able to rename or move read-only files
> -------------------------------------------------------
>
>                 Key: VFS-22
>                 URL: http://issues.apache.org/jira/browse/VFS-22
>             Project: Commons VFS
>          Issue Type: Bug
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Attila Pal
>
> I got this exception when I tried to move a read-only file.
> Caused by: org.apache.commons.vfs.FileSystemException: Could not rename
> "file:///appl/henrich/data_pp/agg_filter/in/data/msgp01-CF7193.DAT_TS_20060419141018"
> because it is read-only.
>         at
> org.apache.commons.vfs.provider.AbstractFileObject.moveTo(AbstractFileObject.java:899)
> I think the correct behaviour is to check the writability on the parent
> directory and not on the file. So I think that a read-only file should be
> deleteable, moveable but not changeable. The ability to move and the ability 
> to
> delete of a file should depend on the rights set on the directory, which
> contains that file.
> I recommend this change in code (it helped to me): 
> Index: src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
> ===================================================================
> --- src/java/org/apache/commons/vfs/provider/AbstractFileObject.java   
> (revision 395811)
> +++ src/java/org/apache/commons/vfs/provider/AbstractFileObject.java    
> (working
> copy)
> @@ -894,7 +894,7 @@
>       */
>      public void moveTo(FileObject destFile) throws FileSystemException
>      {
> -        if (!isWriteable())
> +        if (!(getParent().isWriteable()))
>          {
>              throw new
> FileSystemException("vfs.provider/rename-read-only.error", getName());
>          }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to