commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Ivankovits (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (VFS-22) [vfs] VFS is not able to rename or move read-only files
Date Mon, 02 Oct 2006 19:20:20 GMT
     [ 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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message