public abstract class ClassFilter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ClassFilter.ClassFilterException
Deprecated.
Only used by deprecated
appendDefaultFilter(java.util.regex.Pattern) . |
Modifier and Type | Field and Description |
---|---|
static ClassFilter |
DEFAULT
The currently used default.
|
static String |
FILE_OVERRIDE_LOCATION_PROPERTY
Deprecated.
use
setDefault(hudson.remoting.ClassFilter) as needed |
static ClassFilter |
NONE
No filtering whatsoever.
|
static ClassFilter |
STANDARD
A set of sensible default filtering rules to apply, based on a configurable blacklist.
|
Constructor and Description |
---|
ClassFilter() |
Modifier and Type | Method and Description |
---|---|
static void |
appendDefaultFilter(Pattern filter)
Deprecated.
use
setDefault(hudson.remoting.ClassFilter) as needed |
Class<?> |
check(Class<?> c)
API version of
isBlacklisted(Class) SPI. |
String |
check(String name)
API version of
isBlacklisted(String) SPI. |
boolean |
isBlacklisted(Class<?> c)
Whether a given class should be blocked, after having loaded that class.
|
boolean |
isBlacklisted(String name)
Whether a given class should be blocked, before even attempting to load that class.
|
static void |
setDefault(ClassFilter filter)
Changes the effective value of
DEFAULT . |
@Deprecated public static final String FILE_OVERRIDE_LOCATION_PROPERTY
setDefault(hudson.remoting.ClassFilter)
as neededSTANDARD
with a different set.
The location should point to a a file containing regular expressions (one per line) of classes to blacklist.
If this property is set but the file can not be read the default blacklist will be used.public static final ClassFilter DEFAULT
STANDARD
.public static final ClassFilter STANDARD
public static final ClassFilter NONE
public boolean isBlacklisted(@NonNull String name)
name
- Class.getName()
public boolean isBlacklisted(@NonNull Class<?> c)
c
- a loaded classpublic final String check(String name)
isBlacklisted(String)
SPI.name
SecurityException
- if it is blacklistedpublic final Class<?> check(Class<?> c)
isBlacklisted(Class)
SPI.c
SecurityException
- if it is blacklistedpublic static void setDefault(@NonNull ClassFilter filter)
DEFAULT
.filter
- a new default to set; may or may not delegate to STANDARD
@Deprecated public static void appendDefaultFilter(Pattern filter) throws ClassFilter.ClassFilterException
setDefault(hudson.remoting.ClassFilter)
as neededSTANDARD
.
Does nothing if the default list has already been customized via FILE_OVERRIDE_LOCATION_PROPERTY
.
This API is not supposed to be used anywhere outside Jenkins core, calls for other sources may be rejected later.filter
- a regular expression for Class.getName()
which, if matched according to Matcher.matches()
, will blacklist the classClassFilter.ClassFilterException
- Filter pattern cannot be applied.
It means either unexpected processing error or rejection by the internal logic.Copyright © 2004–2022. All rights reserved.