You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Created) (JIRA)" <ji...@apache.org> on 2011/10/27 08:34:32 UTC

[jira] [Created] (VFS-371) Add FileObject API deleteAllDescendents()

Add FileObject API deleteAllDescendents()
-----------------------------------------

                 Key: VFS-371
                 URL: https://issues.apache.org/jira/browse/VFS-371
             Project: Commons VFS
          Issue Type: New Feature
         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Maven home: C:\Java\apache-maven-3.0.3\bin\..
Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_29\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
            Reporter: Gary D. Gregory
             Fix For: 2.1


I see a lot of call sites within VFS 2 and some in my work server that do:

{code:java}
fileObject.delete(Selectors.SELECT_ALL);
{code}

It therefore seems like a sensible refactoring.

Add to {{FileObject}}:

{code:java}
    /**
     * Deletes all descendents of this file.  
     * Does nothing if this file does not exist.
     * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
     * <p/>
     * <p>This method is not transactional.  If it fails and throws an
     * exception, this file will potentially only be partially deleted.
     *
     * @return the number of deleted objects
     * @throws FileSystemException If this file or one of its descendents is read-only, or on error
     *                             deleting this file or one of its descendents.
     */
    int deleteAllDescendents() throws FileSystemException;
{code}

And to {{AbstractFileObject}}:

{code:java}
    /**
     * Deletes this file, and all children.
     *
     * @return the number of deleted files.
     * @throws FileSystemException if an error occurs.
     */
    public int deleteAllDescendents() throws FileSystemException
    {
        return this.delete(Selectors.SELECT_ALL);
    }
{code}


Thoughts?

Attaching patch.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (VFS-371) Add FileObject API deleteAll()

Posted by "Gary D. Gregory (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved VFS-371.
---------------------------------

       Resolution: Fixed
    Fix Version/s: Nightly Builds
         Assignee: Gary D. Gregory

Committed revision 1198532.
                
> Add FileObject API deleteAll()
> ------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>            Assignee: Gary D. Gregory
>             Fix For: Nightly Builds, 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAll() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (VFS-371) Add FileObject API deleteAllDescendents()

Posted by "Gary D. Gregory (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated VFS-371:
--------------------------------

    Attachment: FileObject-deleteAllDescendents.diff

Patch with tests.
                
> Add FileObject API deleteAllDescendents()
> -----------------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>             Fix For: 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAllDescendents() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (VFS-371) Add FileObject API deleteAllDescendents()

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13137321#comment-13137321 ] 

Gary D. Gregory commented on VFS-371:
-------------------------------------

Alt method name: deleteAll()?
                
> Add FileObject API deleteAllDescendents()
> -----------------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>             Fix For: 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAllDescendents() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (VFS-371) Add FileObject API deleteAll()

Posted by "Gary D. Gregory (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated VFS-371:
--------------------------------

    Description: 
I see a lot of call sites within VFS 2 and some in my work server that do:

{code:java}
fileObject.delete(Selectors.SELECT_ALL);
{code}

It therefore seems like a sensible refactoring.

Add to {{FileObject}}:

{code:java}
    /**
     * Deletes all descendents of this file.  
     * Does nothing if this file does not exist.
     * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
     * <p/>
     * <p>This method is not transactional.  If it fails and throws an
     * exception, this file will potentially only be partially deleted.
     *
     * @return the number of deleted objects
     * @throws FileSystemException If this file or one of its descendents is read-only, or on error
     *                             deleting this file or one of its descendents.
     */
    int deleteAll() throws FileSystemException;
{code}

And to {{AbstractFileObject}}:

{code:java}
    /**
     * Deletes this file, and all children.
     *
     * @return the number of deleted files.
     * @throws FileSystemException if an error occurs.
     */
    public int deleteAllDescendents() throws FileSystemException
    {
        return this.delete(Selectors.SELECT_ALL);
    }
{code}


Thoughts?

Attaching patch.


  was:
I see a lot of call sites within VFS 2 and some in my work server that do:

{code:java}
fileObject.delete(Selectors.SELECT_ALL);
{code}

It therefore seems like a sensible refactoring.

Add to {{FileObject}}:

{code:java}
    /**
     * Deletes all descendents of this file.  
     * Does nothing if this file does not exist.
     * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
     * <p/>
     * <p>This method is not transactional.  If it fails and throws an
     * exception, this file will potentially only be partially deleted.
     *
     * @return the number of deleted objects
     * @throws FileSystemException If this file or one of its descendents is read-only, or on error
     *                             deleting this file or one of its descendents.
     */
    int deleteAllDescendents() throws FileSystemException;
{code}

And to {{AbstractFileObject}}:

{code:java}
    /**
     * Deletes this file, and all children.
     *
     * @return the number of deleted files.
     * @throws FileSystemException if an error occurs.
     */
    public int deleteAllDescendents() throws FileSystemException
    {
        return this.delete(Selectors.SELECT_ALL);
    }
{code}


Thoughts?

Attaching patch.


    
> Add FileObject API deleteAll()
> ------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>             Fix For: 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAll() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (VFS-371) Add FileObject API deleteAll()

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145066#comment-13145066 ] 

Gary D. Gregory commented on VFS-371:
-------------------------------------

I'm going with {{deleteAll()}} for the name.
                
> Add FileObject API deleteAll()
> ------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>             Fix For: 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAll() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (VFS-371) Add FileObject API deleteAllDescendents()

Posted by "Gary D. Gregory (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13137321#comment-13137321 ] 

Gary D. Gregory edited comment on VFS-371 at 10/27/11 5:41 PM:
---------------------------------------------------------------

Alt method name: deleteAll(), deleteAllChildren(), ?
                
      was (Author: garydgregory):
    Alt method name: deleteAll()?
                  
> Add FileObject API deleteAllDescendents()
> -----------------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>             Fix For: 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAllDescendents() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (VFS-371) Add FileObject API deleteAll()

Posted by "Gary D. Gregory (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated VFS-371:
--------------------------------

    Summary: Add FileObject API deleteAll()  (was: Add FileObject API deleteAllDescendents())
    
> Add FileObject API deleteAll()
> ------------------------------
>
>                 Key: VFS-371
>                 URL: https://issues.apache.org/jira/browse/VFS-371
>             Project: Commons VFS
>          Issue Type: New Feature
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
> Maven home: C:\Java\apache-maven-3.0.3\bin\..
> Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_29\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>             Fix For: 2.1
>
>         Attachments: FileObject-deleteAllDescendents.diff
>
>
> I see a lot of call sites within VFS 2 and some in my work server that do:
> {code:java}
> fileObject.delete(Selectors.SELECT_ALL);
> {code}
> It therefore seems like a sensible refactoring.
> Add to {{FileObject}}:
> {code:java}
>     /**
>      * Deletes all descendents of this file.  
>      * Does nothing if this file does not exist.
>      * Shorthand for {@code delete(Selectors.Selectors.SELECT_ALL)}
>      * <p/>
>      * <p>This method is not transactional.  If it fails and throws an
>      * exception, this file will potentially only be partially deleted.
>      *
>      * @return the number of deleted objects
>      * @throws FileSystemException If this file or one of its descendents is read-only, or on error
>      *                             deleting this file or one of its descendents.
>      */
>     int deleteAllDescendents() throws FileSystemException;
> {code}
> And to {{AbstractFileObject}}:
> {code:java}
>     /**
>      * Deletes this file, and all children.
>      *
>      * @return the number of deleted files.
>      * @throws FileSystemException if an error occurs.
>      */
>     public int deleteAllDescendents() throws FileSystemException
>     {
>         return this.delete(Selectors.SELECT_ALL);
>     }
> {code}
> Thoughts?
> Attaching patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira