public final class SecuritySupport extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
checkAccess(String systemId,
String allowedProtocols,
String accessAny)
Check the protocol used in the systemId against allowed protocols
|
static ClassLoader |
getContextClassLoader() |
static boolean |
getFileExists(File f) |
static SecuritySupport |
getInstance()
Return an instance of this class.
|
static String |
getJAXPSystemProperty(String sysPropertyId)
Read JAXP system property in this order: system property,
$java.home/lib/jaxp.properties if the system property is not specified
|
static InputStream |
getResourceAsStream(ClassLoader cl,
String name) |
static InputStream |
getResourceAsStream(String name)
Return resource using the same classloader for the ObjectFactory by
default or bootclassloader when Security Manager is in place
|
static ListResourceBundle |
getResourceBundle(String bundle)
Gets a resource bundle using the specified base name, the default locale, and the caller's class loader.
|
static ListResourceBundle |
getResourceBundle(String bundle,
Locale locale)
Gets a resource bundle using the specified base name and locale, and the caller's class loader.
|
static String |
getSystemProperty(String propName) |
static String |
getSystemProperty(String propName,
String def) |
static String |
sanitizePath(String uri)
Strip off path from an URI
|
public static SecuritySupport getInstance()
public static ClassLoader getContextClassLoader()
public static InputStream getResourceAsStream(String name)
public static InputStream getResourceAsStream(ClassLoader cl, String name)
public static ListResourceBundle getResourceBundle(String bundle)
bundle - the base name of the resource bundle, a fully qualified class namepublic static ListResourceBundle getResourceBundle(String bundle, Locale locale)
bundle - the base name of the resource bundle, a fully qualified class namelocale - the locale for which a resource bundle is desiredpublic static boolean getFileExists(File f)
public static String sanitizePath(String uri)
uri - an URI with full pathpublic static String checkAccess(String systemId, String allowedProtocols, String accessAny) throws IOException
systemId - the Id of the URIallowedProtocols - a list of allowed protocols separated by commaaccessAny - keyword to indicate allowing any protocolIOExceptionCopyright © 2018–2021 mhoffrogge. All rights reserved.