Interface ContentFilter
-
- All Superinterfaces:
ExtensionPoint
- All Known Implementing Classes:
ContentMapping
,InetAddressContentFilter
,SensitiveContentFilter
public interface ContentFilter extends ExtensionPoint
Provides a strategy to filter support bundle written contents. This is primarily useful to anonymize data written to the bundle, though more complex filtering can be achieved.- Since:
- TODO
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static ContentFilter
ALL
Provides a ContentFilter that combines all registered ContentFilter extensions.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static ExtensionList<ContentFilter>
all()
default void
ensureLoaded()
Ensure that the filter has been loaded at least once.static String
filter(ContentFilter filter, String text)
An utility method to filter a text only when both, the filter and the text are not null and the text is not empty too.String
filter(String input)
Filters a line or snippet of text.default void
reload()
Reloads the state of this filter.
-
-
-
Field Detail
-
ALL
static final ContentFilter ALL
Provides a ContentFilter that combines all registered ContentFilter extensions.
-
-
Method Detail
-
all
static ExtensionList<ContentFilter> all()
- Returns:
- all ContentFilter extensions
-
filter
@NonNull String filter(@NonNull String input)
Filters a line or snippet of text.- Parameters:
input
- input data to filter- Returns:
- the filtered input data
-
ensureLoaded
default void ensureLoaded()
Ensure that the filter has been loaded at least once.
-
reload
default void reload()
Reloads the state of this filter. This may be implemented to rescan for more items to filter.
-
filter
static String filter(@CheckForNull ContentFilter filter, @CheckForNull String text)
An utility method to filter a text only when both, the filter and the text are not null and the text is not empty too.- Parameters:
filter
- the filter to use when filteringtext
- the text to filter- Returns:
- the text filtered if it is not empty and the filter is not null
-
-