[
https://issues.apache.org/jira/browse/JCR-3060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jukka Zitting updated JCR-3060:
-------------------------------
Attachment: 0002-JCR-3060-Add-utility-methods-for-path-creation.patch
0001-JCR-3060-Add-utility-methods-for-path-creation.patch
In patch 0001 I've ported the path handling code to the getOrAddNode,
getOrAddFolder and putFile methods, so they could also be given a path instead
of just the name of a child node to be returned or created.
There's also a pair of new addNode() methods that support a "*" node name
suffix for creating unique names using a sequence number. I think that makes
for slightly simpler client code than an extra boolean argument. Note that "*"
may not be used in valid JCR names, so there's no fear of collisions.
With this change the getOrAddNode methods should be able to do pretty much
everything that the new getOrCreate methods do. The only exception is the
autoSave flag, that I think should rather be handled by an explicit
session.save() call by the client. The 0002 patch removes the duplication by
making getOrCreate use getOrAddNode under the hood.
The question now is whether we want to keep the two sets of roughly equivalent
method signatures.
> Add utility methods for path creation
> -------------------------------------
>
> Key: JCR-3060
> URL: https://issues.apache.org/jira/browse/JCR-3060
> Project: Jackrabbit Content Repository
> Issue Type: Improvement
> Components: jackrabbit-jcr-commons
> Affects Versions: 2.2.7
> Reporter: Carsten Ziegeler
> Priority: Minor
> Attachments:
> 0001-JCR-3060-Add-utility-methods-for-path-creation.patch,
> 0002-JCR-3060-Add-utility-methods-for-path-creation.patch, JcrUtils.java.patch
>
>
> While the JcrUtil class has methods to create a node, it does not have
> methods to create paths.
> This patch adds several methods which allow to create or get complete node
> paths
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira