Class UriResolver
java.lang.Object
com.itextpdf.styledxmlparser.resolver.resource.UriResolver
Utilities class to resolve URIs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate URL
The base url.private boolean
Indicates if the Uri refers to a local resource. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate URL
baseUriAsUrl
(String baseUriString) Resolves a base URI as an URL.private String
Gets the base URI.boolean
Check if baseURI is localprivate boolean
isPathRooted
(Path path, String str) resolveAgainstBaseUri
(String uriString) Resolve a given URI against the base URI.private void
resolveBaseUrlOrPath
(String base) Resolves the base URI to an URL or path.private URL
uriAsFileUrl
(String baseUriString) Resolves a base URI as a file URL.
-
Field Details
-
baseUrl
The base url. -
isLocalBaseUri
private boolean isLocalBaseUriIndicates if the Uri refers to a local resource.
-
-
Constructor Details
-
UriResolver
Creates a newUriResolver
instance.- Parameters:
baseUri
- the base URI
-
-
Method Details
-
getBaseUri
Gets the base URI.- Returns:
- the base uri
-
resolveAgainstBaseUri
Resolve a given URI against the base URI.- Parameters:
uriString
- the given URI- Returns:
- the resolved URI
- Throws:
MalformedURLException
- the malformed URL exception
-
isLocalBaseUri
public boolean isLocalBaseUri()Check if baseURI is local- Returns:
- true if baseURI is local, otherwise false
-
resolveBaseUrlOrPath
Resolves the base URI to an URL or path.- Parameters:
base
- the base URI
-
baseUriAsUrl
Resolves a base URI as an URL.- Parameters:
baseUriString
- the base URI- Returns:
- the URL, or null if not successful
-
uriAsFileUrl
Resolves a base URI as a file URL.- Parameters:
baseUriString
- the base URI- Returns:
- the file URL
-
encode
-
isPathRooted
-