java.lang.Object
com.itextpdf.styledxmlparser.resolver.resource.UriResolver

public class UriResolver extends Object
Utilities class to resolve URIs.
  • Field Details

    • baseUrl

      private URL baseUrl
      The base url.
    • isLocalBaseUri

      private boolean isLocalBaseUri
      Indicates if the Uri refers to a local resource.
  • Constructor Details

    • UriResolver

      public UriResolver(String baseUri)
      Creates a new UriResolver instance.
      Parameters:
      baseUri - the base URI
  • Method Details

    • getBaseUri

      public String getBaseUri()
      Gets the base URI.
      Returns:
      the base uri
    • resolveAgainstBaseUri

      public URL resolveAgainstBaseUri(String uriString) throws MalformedURLException
      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

      private void resolveBaseUrlOrPath(String base)
      Resolves the base URI to an URL or path.
      Parameters:
      base - the base URI
    • baseUriAsUrl

      private URL baseUriAsUrl(String baseUriString)
      Resolves a base URI as an URL.
      Parameters:
      baseUriString - the base URI
      Returns:
      the URL, or null if not successful
    • uriAsFileUrl

      private URL uriAsFileUrl(String baseUriString)
      Resolves a base URI as a file URL.
      Parameters:
      baseUriString - the base URI
      Returns:
      the file URL
    • encode

      private String encode(Path path, String str)
    • isPathRooted

      private boolean isPathRooted(Path path, String str)