Class AbstractCustomProvider
java.lang.Object
hudson.model.Descriptor<Config>
org.jenkinsci.lib.configprovider.ConfigProvider
org.jenkinsci.lib.configprovider.AbstractConfigProviderImpl
org.jenkinsci.plugins.configfiles.custom.AbstractCustomProvider
- All Implemented Interfaces:
ExtensionPoint
,Saveable
,OnMaster
- Direct Known Subclasses:
CustomConfig.CustomConfigProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class org.jenkinsci.lib.configprovider.AbstractConfigProviderImpl
configs
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe content type of the configs this provider manages.getSensitiveContentForMasking
(Config configFile, Run<?, ?> build) Obtain a list of sensitive Strings to mask for the given provider and build.supplyContent
(Config configFile, Run<?, ?> build, FilePath workDir, TaskListener listener, List<String> tempFiles) Provide the given content file.Methods inherited from class org.jenkinsci.lib.configprovider.AbstractConfigProviderImpl
clearOldDataStorage, convert, getConfigs, getConfigXml, getProviderId, getXmlFileName, load, save
Methods inherited from class org.jenkinsci.lib.configprovider.ConfigProvider
all, configExists, getAllConfigs, getByIdOrNull, getConfigById, newConfig, newConfig, newConfig, remove, save, supportsFolder
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, self, toArray, toList, toMap
-
Constructor Details
-
AbstractCustomProvider
public AbstractCustomProvider()
-
-
Method Details
-
getContentType
Description copied from class:ConfigProvider
The content type of the configs this provider manages. e.g. can be used to display the content in the UI (editor).- Specified by:
getContentType
in classConfigProvider
- Returns:
- the type.
null
if no specific formatting should be supported.
-
supplyContent
public String supplyContent(Config configFile, Run<?, ?> build, FilePath workDir, TaskListener listener, List<String> tempFiles) throws IOExceptionDescription copied from class:ConfigProvider
Provide the given content file. Implementation Note:If this is overridden in a sub class and credentials are injected into the content - then the implementation must also overrideConfigProvider.getSensitiveContentForMasking(Config, Run)
to avoid accidental disclosure.- Overrides:
supplyContent
in classConfigProvider
- Parameters:
configFile
- the file content to be providedworkDir
- target workspace directorylistener
- the listenertempFiles
- temp files created by this method, these files will be deleted by the caller- Returns:
- file content
- Throws:
IOException
- in case an exception occurs when providing the content or other needed files- See Also:
-
getSensitiveContentForMasking
Description copied from class:ConfigProvider
Obtain a list of sensitive Strings to mask for the given provider and build. For example if aUsernamePasswordCredentials
is being injected into a file then the password (and possibly the username) from the resolved credential would need to be masked and should be returned here.- Overrides:
getSensitiveContentForMasking
in classConfigProvider
- Parameters:
configFile
- the file content to provide sensitive strings for.build
- the build for which the configFile applies.- Returns:
- List of Strings that need to be masked in the console.
-