Package hudson.model
Interface ItemGroup<T extends Item>
- All Superinterfaces:
FullyNamed,FullyNamedModelObject,ModelObject,PersistenceRoot,Saveable
- All Known Subinterfaces:
DirectlyModifiableTopLevelItemGroup,ModifiableItemGroup<T>,ModifiableTopLevelItemGroup
- All Known Implementing Classes:
AbstractCIBase,Hudson,Jenkins
public interface ItemGroup<T extends Item>
extends FullyNamed, FullyNamedModelObject, PersistenceRoot
Represents a grouping inherent to a kind of
Items.- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionallItems()Gets all the items unordered, lazily and recursively.Gets all the items recursively.getAllItems(Class<T> type) getAllItems(Class<T> type, Predicate<T> pred) Similar togetAllItems(Class)with additional predicate filteringGets theIteminside this group that has a given name, or null if it does not exist.default StringgetItemName(File dir, T item) Determines the item name based on a logic that can be overridden (e.g.getItems()Gets all the items in this collection in a read-only view.default Collection<T> Gets all the items in this collection in a read-only view that matches supplied PredicateGets a read-only stream of all the items in this collectiongetItemsStream(Predicate<T> pred) Gets a read-only stream of all the items in this collection that matches supplied PredicategetRootDirFor(T child) Assigns theroot directoryfor children.getUrl()Returns the path relative to the context root, like "foo/bar/zot/".Gets the URL token that prefixes the URLs for childItems.voidInternal method.default voidInternal method.Methods inherited from interface jenkins.model.FullyNamed
getFullNameMethods inherited from interface jenkins.model.FullyNamedModelObject
getFullDisplayNameMethods inherited from interface hudson.model.ModelObject
getDisplayNameMethods inherited from interface hudson.model.PersistenceRoot
getRootDir
-
Method Details
-
getItems
Collection<T> getItems()Gets all the items in this collection in a read-only view. -
getItems
Gets all the items in this collection in a read-only view that matches supplied Predicate- Since:
- 2.221
-
getItemsStream
Gets a read-only stream of all the items in this collection- Since:
- 2.221
-
getItemsStream
Gets a read-only stream of all the items in this collection that matches supplied Predicate- Since:
- 2.221
-
getUrl
String getUrl()Returns the path relative to the context root, like "foo/bar/zot/". Note no leading slash but trailing slash. -
getUrlChildPrefix
String getUrlChildPrefix()Gets the URL token that prefixes the URLs for childItems. Like "job", "item", etc. -
getItem
@CheckForNull T getItem(String name) throws org.springframework.security.access.AccessDeniedException Gets theIteminside this group that has a given name, or null if it does not exist.- Returns:
- an item whose
Item.getName()isnameand whoseItem.getParent()isthis, or null if there is no such item, or there is but the current user lacks bothItem.DISCOVERandItem.READon it - Throws:
org.springframework.security.access.AccessDeniedException- if the current user hasItem.DISCOVERbut notItem.READon this item
-
getRootDirFor
Assigns theroot directoryfor children. -
onRenamed
Internal method. Called byItems when they are renamed by users. This is not expected to callItemListener.onRenamed(hudson.model.Item, java.lang.String, java.lang.String), inconsistent withonDeleted(T).- Throws:
IOException
-
onDeleted
Internal method. Called byItems when they are deleted by users.- Throws:
IOException
-
getAllItems
- Since:
- 2.93
-
getAllItems
Similar togetAllItems(Class)with additional predicate filtering- Since:
- 2.221
-
allItems
Gets all theItems unordered, lazily and recursively in theItemGrouptree and filter them by the given type.- Since:
- 2.93
-
allItems
Gets all theItems unordered, lazily and recursively in theItemGrouptree and filter them by the given type and given predicate- Since:
- 2.221
-
getAllItems
Gets all the items recursively.- Since:
- 2.93
-
allItems
Gets all the items unordered, lazily and recursively.- Since:
- 2.93
-
getItemName
Determines the item name based on a logic that can be overridden (e.g. by AbstractFolder). Defaults to the item root directory name.- Parameters:
dir- The root directory the item was loaded from.item- the partially loaded item (take care what methods you call, the item will not have a reference to its parent).- Since:
- 2.444
-