[Yanel-dev] Yarep delete method

Josias Thöny josias.thoeny at wyona.com
Mon Jul 23 08:21:04 CEST 2007


Michael Wechner wrote:
> Hi
> 
> I have noticed that according to the API calling delete also is supposed 
> to delete all children resp. also non-empty collections
> 
> src/core/java/org/wyona/yarep/core/Node.java
> 
>    /**
>     * Deletes this node and all subnodes.
>     * The root node cannot be deleted.
>     * @throws RepositoryException if this node is the root node or if a 
> repository error occurs.
>     */
>    public void delete() throws RepositoryException;
> 
> 
> Shouldn't we introduce something like
> 
> 
> delete(boolean recursive)
> 
> which would allow to block the deletion of non-empty collections when 
> being set to delete(false)
> 

IIUC this would mean that a caller of delete(false) has to check 
afterwards if the operation has been successful.
Then you could as well check if the node has any child nodes before you 
call delete().
Where do you see the advantage of using delete(false)?

josias

> ?
> 
> This would corrspond to rm -r
> 
> WDYT?
> 
> Cheers
> 
> Michi
> 



More information about the Yanel-development mailing list