Class RelativeUrlResolver

java.lang.Object
org.apache.ivy.core.RelativeUrlResolver
Direct Known Subclasses:
ExecutionRelativeUrlResolver, NormalRelativeUrlResolver

public abstract class RelativeUrlResolver extends Object
Resolve an file or url relatively to its context.
  • Constructor Details

    • RelativeUrlResolver

      public RelativeUrlResolver()
  • Method Details

    • getURL

      public abstract URL getURL(URL context, String url) throws MalformedURLException
      Resolve the url in the context of context.
      Parameters:
      context - The URL of the resource containing the reference url
      url - a relative or absolution url string
      Returns:
      URL
      Throws:
      MalformedURLException - if url is wrong
    • getURL

      public URL getURL(URL context, String file, String url) throws MalformedURLException
      Resolve file or url path relatively to a context. file is considered first. If file is not defined, url will be considered.
      Parameters:
      context - The URL of the resource containing the reference file or url
      file - a relative or absolute path
      url - a relative or absolution url string
      Returns:
      the resulting url or null if failed and url are null.
      Throws:
      MalformedURLException - if url is wrong