Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 44981 invoked from network); 2 Oct 2006 19:20:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Oct 2006 19:20:40 -0000 Received: (qmail 82810 invoked by uid 500); 2 Oct 2006 19:20:37 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 82720 invoked by uid 500); 2 Oct 2006 19:20:37 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 82709 invoked by uid 99); 2 Oct 2006 19:20:37 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 12:20:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:36249] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 73/E5-24395-18661254 for ; Mon, 02 Oct 2006 12:20:34 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8DACB71430D for ; Mon, 2 Oct 2006 12:20:20 -0700 (PDT) Message-ID: <167792.1159816820577.JavaMail.root@brutus> Date: Mon, 2 Oct 2006 12:20:20 -0700 (PDT) From: "Mario Ivankovits (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Resolved: (VFS-22) [vfs] VFS is not able to rename or move read-only files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ 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