APIdia Launch Partner
Top Fields Constructors Methods
javax.xml.catalog

pack-priv Class Util

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.net.MalformedURLException, .URI, .URL, java.util.Iterator, java.util.jar.JarEntry, .JarFile, javax.xml.catalog.CatalogFeatures.Feature, jdk.xml.internal.SecuritySupport

Since
9

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String

Constructor Summary

AccessConstructor and Description
pack-priv
Util()

Method Summary

Modifier and TypeMethod and Description
pack-priv static String

Returns:

the absolute form of the specified uri
getAbsoluteURI
(String
the base, that is the system id of the catalog within the Catalog implementation
base
,
String
the specified uri
uri
)

Returns the absolute form of the specified uri after resolving it against the base.

pack-priv static String[]

Returns:

the catalog file paths, or null if not found.
getCatalogFiles
(String
the name of system property
sysPropertyName
)

Find catalog file paths by reading the system property, and then jaxp.properties if the system property is not specified.

pack-priv static String

Returns:

the original string with leading and trailing spaces removed, or null if it is null or empty
getNotNullOrEmpty
(String
the string to be tested
test
)

Checks whether the specified string is null or empty, returns the original string with leading and trailing spaces removed if not.

pack-priv static boolean

Returns:

true if it is a file or JAR file URI, false otherwise
isFileUri
(URI
the specified URI.
uri
)

Checks whether the URI is a file URI, including JAR file.

pack-priv static boolean

Returns:

true if the resource exists, false otherwise.
isFileUriExist
(URI
the URI to locate the resource
uri
,
boolean
a flag to indicate whether a JAR file should be opened. This operation may be expensive.
openJarFile
)

Verifies whether the file resource exists.

pack-priv static String

Returns:

the resolved systemId if a match is found, null otherwise
resolve
(CatalogImpl
the catalog
catalog
,
String
the publicId
publicId
,
String
the systemId
systemId
)

Finds an entry in the catalog that matches with the publicId or systemId.

pack-priv static void
validateFeatureInput(CatalogFeatures.Feature
the feature
f
,
String
the value
value
)

Validates the input for features.

pack-priv static void
pack-priv static void
pack-priv static void
validateUriSyntax(URI uri)

Validate that the URI must be absolute and a valid URL.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PUBLICID_PREFIXback to summary
pack-priv static final String PUBLICID_PREFIX
PUBLICID_PREFIX_ALTback to summary
pack-priv static final String PUBLICID_PREFIX_ALT
SCHEME_FILEback to summary
pack-priv static final String SCHEME_FILE
SCHEME_JARback to summary
pack-priv static final String SCHEME_JAR
SCHEME_JARFILEback to summary
pack-priv static final String SCHEME_JARFILE
URNback to summary
pack-priv static final String URN

Constructor Detail

Utilback to summary
pack-priv Util()

Method Detail

getAbsoluteURIback to summary
pack-priv static String getAbsoluteURI(String base, String uri)

Returns the absolute form of the specified uri after resolving it against the base. Returns the uri as is if it's already absolute.

Parameters
base:String

the base, that is the system id of the catalog within the Catalog implementation

uri:String

the specified uri

Returns:String

the absolute form of the specified uri

Annotations
@SuppressWarnings:deprecation
getCatalogFilesback to summary
pack-priv static String[] getCatalogFiles(String sysPropertyName)

Find catalog file paths by reading the system property, and then jaxp.properties if the system property is not specified.

Parameters
sysPropertyName:String

the name of system property

Returns:String[]

the catalog file paths, or null if not found.

getNotNullOrEmptyback to summary
pack-priv static String getNotNullOrEmpty(String test)

Checks whether the specified string is null or empty, returns the original string with leading and trailing spaces removed if not.

Parameters
test:String

the string to be tested

Returns:String

the original string with leading and trailing spaces removed, or null if it is null or empty

isFileUriback to summary
pack-priv static boolean isFileUri(URI uri)

Checks whether the URI is a file URI, including JAR file.

Parameters
uri:URI

the specified URI.

Returns:boolean

true if it is a file or JAR file URI, false otherwise

isFileUriExistback to summary
pack-priv static boolean isFileUriExist(URI uri, boolean openJarFile)

Verifies whether the file resource exists.

Parameters
uri:URI

the URI to locate the resource

openJarFile:boolean

a flag to indicate whether a JAR file should be opened. This operation may be expensive.

Returns:boolean

true if the resource exists, false otherwise.

resolveback to summary
pack-priv static String resolve(CatalogImpl catalog, String publicId, String systemId)

Finds an entry in the catalog that matches with the publicId or systemId. The resolution follows the following rules determined by the prefer setting: prefer "system": attempts to resolve with a system entry; attempts to resolve with a public entry when only publicId is specified. prefer "public": attempts to resolve with a system entry; attempts to resolve with a public entry if no matching system entry is found. If no match is found, continue searching uri entries

Parameters
catalog:CatalogImpl

the catalog

publicId:String

the publicId

systemId:String

the systemId

Returns:String

the resolved systemId if a match is found, null otherwise

validateFeatureInputback to summary
pack-priv static void validateFeatureInput(CatalogFeatures.Feature f, String value)

Validates the input for features.

Parameters
f:CatalogFeatures.Feature

the feature

value:String

the value

Exceptions
IllegalArgumentException:
if the value is invalid for the feature
validateUrisSyntaxback to summary
pack-priv static void validateUrisSyntax(URI... uris)
validateUrisSyntaxback to summary
pack-priv static void validateUrisSyntax(String... uris)
validateUriSyntaxback to summary
pack-priv static void validateUriSyntax(URI uri)

Validate that the URI must be absolute and a valid URL. Note that this method does not verify the existence of the resource. The Catalog standard requires that such resources be ignored.

Exceptions
IllegalArgumentException:
if the uri is not absolute and a valid URL