public interface DirectlyModifiableTopLevelItemGroup extends ModifiableTopLevelItemGroup
Modifier and Type | Method and Description |
---|---|
<I extends TopLevelItem> |
add(I item,
String name)
Adds an item to this group.
|
boolean |
canAdd(TopLevelItem item)
Returns true if a particular item may be added to this group.
|
void |
remove(TopLevelItem item)
Removes an item from this group.
|
copy, createProject, createProjectFromXML
doCreateItem
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItem, getItems, getItems, getItemsStream, getItemsStream, getRootDirFor, getUrl, getUrlChildPrefix, onDeleted, onRenamed
getRootDir
getDisplayName
boolean canAdd(TopLevelItem item)
item
- an item currently elsewhereadd(I, java.lang.String)
may be called with this item<I extends TopLevelItem> I add(I item, String name) throws IOException, IllegalArgumentException
Jenkins.putItem(hudson.model.TopLevelItem)
this does not try to call Item.delete()
on an existing item, nor does it fire ItemListener.onCreated(hudson.model.Item)
, nor check permissions.
Normally you would call Item.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
after calling this method (the implementation is not expected to do so).I
- the kind of itemitem
- an item to add which is currently elsewherename
- the desired item name in this group (might simply be the original Item.getName()
)item
, but might be a new copy if necessaryIOException
- if adding failsIllegalArgumentException
- if canAdd(hudson.model.TopLevelItem)
is false, or an item with this name already exists, or this item is as yet unnamedvoid remove(TopLevelItem item) throws IOException, IllegalArgumentException
ItemGroup.onDeleted(T)
this is not expected to fire any events.item
- an item which was part of this groupIOException
- if removing failsIllegalArgumentException
- if this was not part of the group to begin withCopyright © 2004–2021. All rights reserved.