Package hudson.model
Class ItemGroupMixIn
java.lang.Object
hudson.model.ItemGroupMixIn
Defines a bunch of static methods to be used as a "mix-in" for
ItemGroup
implementations. Not meant for a consumption from outside ItemGroup
s.- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
add
(TopLevelItem item) Adds a newly created item to the parent.<T extends TopLevelItem>
TCopies an existingTopLevelItem
to a new name.createProject
(TopLevelItemDescriptor type, String name, boolean notify) createProjectFromXML
(String name, InputStream xml) createTopLevelItem
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Creates aTopLevelItem
for example from the submission of the/lib/hudson/newFromList/form
tag or throws an exception if it fails.createTopLevelItem
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Deprecated.protected abstract File
getRootDirFor
(String name) Assigns the root directory for a prospective item.loadChildren
(ItemGroup parent, File modulesDir, Function1<? extends K, ? super V> key) Loads all the childItem
s.protected String
redirectAfterCreateItem
(org.kohsuke.stapler.StaplerRequest2 req, TopLevelItem result) Computes the redirection target URL for the newly createdTopLevelItem
.
-
Field Details
-
KEYED_BY_NAME
Item
→ name function.
-
-
Constructor Details
-
ItemGroupMixIn
-
-
Method Details
-
add
Adds a newly created item to the parent. -
getRootDirFor
Assigns the root directory for a prospective item. -
loadChildren
public static <K,V extends Item> Map<K,V> loadChildren(ItemGroup parent, File modulesDir, Function1<? extends K, ? super V> key) Loads all the childItem
s.- Parameters:
modulesDir
- Directory that contains sub-directories for each child item.
-
createTopLevelItem
public TopLevelItem createTopLevelItem(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Creates aTopLevelItem
for example from the submission of the/lib/hudson/newFromList/form
tag or throws an exception if it fails.- Throws:
IOException
jakarta.servlet.ServletException
- Since:
- 2.475
-
createTopLevelItem
@Deprecated public TopLevelItem createTopLevelItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
redirectAfterCreateItem
protected String redirectAfterCreateItem(org.kohsuke.stapler.StaplerRequest2 req, TopLevelItem result) throws IOException Computes the redirection target URL for the newly createdTopLevelItem
.- Throws:
IOException
-
copy
Copies an existingTopLevelItem
to a new name.- Throws:
IOException
-
createProjectFromXML
- Throws:
IOException
-
createProject
@NonNull public TopLevelItem createProject(@NonNull TopLevelItemDescriptor type, @NonNull String name, boolean notify) throws IOException - Throws:
IOException
-
createTopLevelItem(StaplerRequest2, StaplerResponse2)