Class Folder
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.AbstractItem
-
- com.cloudbees.hudson.plugins.folder.AbstractFolder<TopLevelItem>
-
- com.cloudbees.hudson.plugins.folder.Folder
-
- All Implemented Interfaces:
ExtensionPoint,Describable<TopLevelItem>,DescriptorByNameOwner,Item,ItemGroup<TopLevelItem>,ModelObject,ModifiableItemGroup<TopLevelItem>,ModifiableViewGroup,PersistenceRoot,Saveable,TopLevelItem,ViewGroup,SearchableModelObject,SearchItem,AccessControlled,DirectlyModifiableTopLevelItemGroup,Loadable,ModelObjectWithChildren,ModelObjectWithContextMenu,ModifiableTopLevelItemGroup,OnMaster,org.kohsuke.stapler.HttpDeletable,org.kohsuke.stapler.StaplerFallback,org.kohsuke.stapler.StaplerOverridable,org.kohsuke.stapler.StaplerProxy
public class Folder extends AbstractFolder<TopLevelItem> implements DirectlyModifiableTopLevelItemGroup
A mutable folder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFolder.DeprecatedTransientActionsDeprecated.static classFolder.DescriptorImpl-
Nested classes/interfaces inherited from class com.cloudbees.hudson.plugins.folder.AbstractFolder
AbstractFolder.ItemListenerImpl, AbstractFolder.RunListenerImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static AlternativeUiTextProvider.Message<Folder>NEW_PRONOUNprotected List<Action>transientActionsDeprecated.UseTransientActionFactoryinstead.-
Fields inherited from class com.cloudbees.hudson.plugins.folder.AbstractFolder
items, reloadingThis
-
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <I extends TopLevelItem>
Iadd(I item, String name)voidaddProperty(FolderProperty<?> p)Deprecated.booleancanAdd(TopLevelItem item)<T extends TopLevelItem>
Tcopy(T src, String name)Copies an existingTopLevelItemto into this folder with a new name.TopLevelItemcreateProject(TopLevelItemDescriptor type, String name)TopLevelItemcreateProject(TopLevelItemDescriptor type, String name, boolean notify)<T extends TopLevelItem>
TcreateProject(Class<T> type, String name)TopLevelItemcreateProjectFromXML(String name, InputStream xml)protected List<Action>createTransientActions()Deprecated.TopLevelItemdoCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)DescribableList<ListViewColumn,Descriptor<ListViewColumn>>getColumns()Deprecated.as of 1.7 Folder is no longer a view by itself.Folder.DescriptorImplgetDescriptor()List<TopLevelItemDescriptor>getItemDescriptors()Items that can be created in thisFolder.StringgetNewPronoun()Used in "New Job" side menu.protected voidinit()protected voidinitViews(List<View> views)booleanisAllowedChild(TopLevelItem tid)Historical synonym forcanAdd(hudson.model.TopLevelItem).booleanisAllowedChildDescriptor(TopLevelItemDescriptor tid)Returns true if the specified descriptor type is allowed for this container.voidonCopiedFrom(Item _src)If copied, copy folder contents.voidonCreatedFromScratch()voidonLoad(ItemGroup<? extends Item> parent, String name)voidremove(TopLevelItem item)protected voidsubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)protected voidupdateTransientActions()Deprecated.UseTransientActionFactoryinstead.-
Methods inherited from class com.cloudbees.hudson.plugins.folder.AbstractFolder
addLoadedChild, addProperty, addView, canDelete, checkRename, deleteView, doChildrenContextMenu, doConfigSubmit, doCreateView, doDisable, doEnable, doLastBuild, doSubmitDescription, doViewExistsCheck, getAllJobs, getBuildHealth, getBuildHealthReports, getFolderViews, getHealthMetrics, getIcon, getIconColor, getItem, getItemGroup, getItemName, getItems, getItems, getJob, getJobsDir, getOverrides, getPrimaryView, getPronoun, getProperties, getRootDirFor, getRootDirFor, getStaplerFallback, getSuccessfulDestination, getUrlChildPrefix, getView, getViewActions, getViews, getViewsTabBar, hasVisibleItems, invalidateBuildHealthReports, isDisabled, isNameEditable, itemsPut, loadChildren, loadJobTotal, makeDisabled, makeSearchIndex, newDefaultFolderIcon, newDefaultViewsTabBar, newFolderViewHolder, onDeleted, onRenamed, onViewRenamed, reloadThis, renameBlocker, renameTo, resetFolderViews, save, setDisabled, setIcon, setPrimaryView, supportsMakeDisabled
-
Methods inherited from class hudson.model.AbstractItem
delete, delete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doReload, doSetName, getAbsoluteUrl, getACL, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, load, movedTo, performDelete, resolveForCLI, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml, writeReplace
-
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl
-
Methods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItem, getItemName, getItems, getItems, getItemsStream, getItemsStream, getRootDirFor, getUrl, getUrlChildPrefix, onDeleted, onRenamed
-
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
-
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
-
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
-
Methods inherited from interface hudson.model.ViewGroup
getAllViews, getUrl
-
-
-
-
Field Detail
-
NEW_PRONOUN
public static final AlternativeUiTextProvider.Message<Folder> NEW_PRONOUN
- Since:
- 4.0
- See Also:
getNewPronoun()
-
transientActions
@CopyOnWrite @Deprecated protected transient volatile List<Action> transientActions
Deprecated.UseTransientActionFactoryinstead.
-
-
Method Detail
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
Description copied from class:AbstractFolder- Specified by:
onLoadin interfaceItem- Overrides:
onLoadin classAbstractFolder<TopLevelItem>- Throws:
IOException
-
init
protected final void init()
- Overrides:
initin classAbstractFolder<TopLevelItem>
-
initViews
protected void initViews(List<View> views) throws IOException
- Overrides:
initViewsin classAbstractFolder<TopLevelItem>- Throws:
IOException
-
onCreatedFromScratch
public void onCreatedFromScratch()
- Specified by:
onCreatedFromScratchin interfaceItem
-
updateTransientActions
@Deprecated protected void updateTransientActions()
Deprecated.UseTransientActionFactoryinstead.
-
createTransientActions
@Deprecated protected List<Action> createTransientActions()
Deprecated.
-
getNewPronoun
public String getNewPronoun()
Used in "New Job" side menu.- Returns:
- the pronoun for new item creation.
- See Also:
NEW_PRONOUN
-
getColumns
@Deprecated public DescribableList<ListViewColumn,Descriptor<ListViewColumn>> getColumns()
Deprecated.as of 1.7 Folder is no longer a view by itself.- Returns:
- the columns.
-
addProperty
@Deprecated public void addProperty(FolderProperty<?> p) throws IOException
Deprecated.Legacy binary compatibility method.- Parameters:
p- the property.- Throws:
IOException- if the folder could not be saved.
-
onCopiedFrom
public void onCopiedFrom(Item _src)
If copied, copy folder contents.- Specified by:
onCopiedFromin interfaceItem- Overrides:
onCopiedFromin classAbstractItem
-
doCreateItem
@POST public TopLevelItem doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
- Specified by:
doCreateItemin interfaceModifiableItemGroup<TopLevelItem>- Throws:
IOExceptionjavax.servlet.ServletException
-
copy
public <T extends TopLevelItem> T copy(T src, String name) throws IOException
Copies an existingTopLevelItemto into this folder with a new name.- Specified by:
copyin interfaceModifiableTopLevelItemGroup- Throws:
IOException
-
createProjectFromXML
public TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException
- Specified by:
createProjectFromXMLin interfaceModifiableTopLevelItemGroup- Throws:
IOException
-
createProject
public <T extends TopLevelItem> T createProject(Class<T> type, String name) throws IOException
- Throws:
IOException
-
createProject
public TopLevelItem createProject(TopLevelItemDescriptor type, String name) throws IOException
- Throws:
IOException
-
createProject
public TopLevelItem createProject(TopLevelItemDescriptor type, String name, boolean notify) throws IOException
- Specified by:
createProjectin interfaceModifiableTopLevelItemGroup- Throws:
IOException
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException- Overrides:
submitin classAbstractFolder<TopLevelItem>- Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
getItemDescriptors
public List<TopLevelItemDescriptor> getItemDescriptors()
Items that can be created in thisFolder.- Returns:
- the descriptors of items that can be created within this folder.
- See Also:
FolderAddFilter
-
isAllowedChildDescriptor
public boolean isAllowedChildDescriptor(TopLevelItemDescriptor tid)
Returns true if the specified descriptor type is allowed for this container.- Parameters:
tid- the type of child item.- Returns:
trueif it can be added.
-
isAllowedChild
public boolean isAllowedChild(TopLevelItem tid)
Historical synonym forcanAdd(hudson.model.TopLevelItem).- Parameters:
tid- the potential child item.- Returns:
trueif it can be added.
-
getDescriptor
public Folder.DescriptorImpl getDescriptor()
Description copied from class:AbstractFolder- Specified by:
getDescriptorin interfaceDescribable<TopLevelItem>- Specified by:
getDescriptorin interfaceTopLevelItem- Overrides:
getDescriptorin classAbstractFolder<TopLevelItem>
-
canAdd
public boolean canAdd(TopLevelItem item)
- Specified by:
canAddin interfaceDirectlyModifiableTopLevelItemGroup
-
add
public <I extends TopLevelItem> I add(I item, String name) throws IOException, IllegalArgumentException
- Specified by:
addin interfaceDirectlyModifiableTopLevelItemGroup- Throws:
IOExceptionIllegalArgumentException
-
remove
public void remove(TopLevelItem item) throws IOException, IllegalArgumentException
- Specified by:
removein interfaceDirectlyModifiableTopLevelItemGroup- Throws:
IOExceptionIllegalArgumentException
-
-