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
,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 class
Folder.DeprecatedTransientActions
Deprecated.static class
Folder.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_PRONOUN
protected List<Action>
transientActions
Deprecated.UseTransientActionFactory
instead.-
Fields inherited from class com.cloudbees.hudson.plugins.folder.AbstractFolder
items
-
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)
void
addProperty(FolderProperty<?> p)
Deprecated.boolean
canAdd(TopLevelItem item)
<T extends TopLevelItem>
Tcopy(T src, String name)
Copies an existingTopLevelItem
to into this folder with a new name.TopLevelItem
createProject(TopLevelItemDescriptor type, String name)
TopLevelItem
createProject(TopLevelItemDescriptor type, String name, boolean notify)
<T extends TopLevelItem>
TcreateProject(Class<T> type, String name)
TopLevelItem
createProjectFromXML(String name, InputStream xml)
protected List<Action>
createTransientActions()
Deprecated.TopLevelItem
doCreateItem(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.DescriptorImpl
getDescriptor()
List<TopLevelItemDescriptor>
getItemDescriptors()
Items that can be created in thisFolder
.String
getNewPronoun()
Used in "New Job" side menu.protected void
init()
protected void
initViews(List<View> views)
boolean
isAllowedChild(TopLevelItem tid)
Historical synonym forcanAdd(hudson.model.TopLevelItem)
.boolean
isAllowedChildDescriptor(TopLevelItemDescriptor tid)
Returns true if the specified descriptor type is allowed for this container.void
onCopiedFrom(Item _src)
If copied, copy folder contents.void
onCreatedFromScratch()
void
onLoad(ItemGroup<? extends Item> parent, String name)
void
remove(TopLevelItem item)
protected void
submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
protected void
updateTransientActions()
Deprecated.UseTransientActionFactory
instead.-
Methods inherited from class com.cloudbees.hudson.plugins.folder.AbstractFolder
addProperty, addView, canDelete, checkRename, delete, deleteView, doChildrenContextMenu, doConfigSubmit, doCreateView, doDisable, doEnable, doLastBuild, doSubmitDescription, doViewExistsCheck, getAllJobs, getBuildHealth, getBuildHealthReports, getFolderViews, getHealthMetrics, getIcon, getIconColor, getItem, getItemGroup, 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, renameBlocker, renameTo, resetFolderViews, save, setDisabled, setIcon, setPrimaryView, supportsMakeDisabled
-
Methods inherited from class hudson.model.AbstractItem
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, 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
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, 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.UseTransientActionFactory
instead.
-
-
Method Detail
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
Description copied from class:AbstractFolder
- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in classAbstractFolder<TopLevelItem>
- Throws:
IOException
-
init
protected final void init()
- Overrides:
init
in classAbstractFolder<TopLevelItem>
-
initViews
protected void initViews(List<View> views) throws IOException
- Overrides:
initViews
in classAbstractFolder<TopLevelItem>
- Throws:
IOException
-
onCreatedFromScratch
public void onCreatedFromScratch()
- Specified by:
onCreatedFromScratch
in interfaceItem
-
updateTransientActions
@Deprecated protected void updateTransientActions()
Deprecated.UseTransientActionFactory
instead.
-
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
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:
onCopiedFrom
in interfaceItem
- Overrides:
onCopiedFrom
in classAbstractItem
-
doCreateItem
@POST public TopLevelItem doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
- Specified by:
doCreateItem
in interfaceModifiableItemGroup<TopLevelItem>
- Throws:
IOException
javax.servlet.ServletException
-
copy
public <T extends TopLevelItem> T copy(T src, String name) throws IOException
Copies an existingTopLevelItem
to into this folder with a new name.- Specified by:
copy
in interfaceModifiableTopLevelItemGroup
- Throws:
IOException
-
createProjectFromXML
public TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException
- Specified by:
createProjectFromXML
in 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:
createProject
in 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:
submit
in classAbstractFolder<TopLevelItem>
- Throws:
IOException
javax.servlet.ServletException
Descriptor.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:
true
if it can be added.
-
isAllowedChild
public boolean isAllowedChild(TopLevelItem tid)
Historical synonym forcanAdd(hudson.model.TopLevelItem)
.- Parameters:
tid
- the potential child item.- Returns:
true
if it can be added.
-
getDescriptor
public Folder.DescriptorImpl getDescriptor()
Description copied from class:AbstractFolder
- Specified by:
getDescriptor
in interfaceDescribable<TopLevelItem>
- Specified by:
getDescriptor
in interfaceTopLevelItem
- Overrides:
getDescriptor
in classAbstractFolder<TopLevelItem>
-
canAdd
public boolean canAdd(TopLevelItem item)
- Specified by:
canAdd
in interfaceDirectlyModifiableTopLevelItemGroup
-
add
public <I extends TopLevelItem> I add(I item, String name) throws IOException, IllegalArgumentException
- Specified by:
add
in interfaceDirectlyModifiableTopLevelItemGroup
- Throws:
IOException
IllegalArgumentException
-
remove
public void remove(TopLevelItem item) throws IOException, IllegalArgumentException
- Specified by:
remove
in interfaceDirectlyModifiableTopLevelItemGroup
- Throws:
IOException
IllegalArgumentException
-
-