[
https://issues.apache.org/jira/browse/STANBOL-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217207#comment-13217207
]
Rupert Westenthaler commented on STANBOL-513:
---------------------------------------------
NOTE: The removal of ContentParts would reduce the index of parts with higher
indexes by one.
Current usages of the contentPart API indicate that this is not a problem
because index based access is currently only used to iterate over ContentParts
sorted by their insertion. (see ContentItemHelper for examples).
> Allow removal of ContentParts from a ContentItem
> ------------------------------------------------
>
> Key: STANBOL-513
> URL: https://issues.apache.org/jira/browse/STANBOL-513
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Rupert Westenthaler
> Assignee: Rupert Westenthaler
> Priority: Minor
>
> The Java API of the ContentItem does currently not allow to remove
> ContentParts.
> This issue requests the following two new methods
> void removePart(int index)
> void removePart(UriRef uri)
> Both methods throw the following RuntimeExceptions:
> * NoSuchPartException if no part with the parsed index/uri exists
> * IllegalArgumentException if <code>null</code> is parsed as uri or clazz.
> * IllegalStateException if the request tries to remove the main content part
> of the ContentItem.
> NOTE: the remove methods do NOT return a boolean value but rather throws one
> of the above RuntimeExceptions if the requested part was NOT be removed. This
> is consitent with the addConentPart(..) methods.
--
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