Class UrlPathTokenizer

java.lang.Object
scriptella.util.UrlPathTokenizer

public class UrlPathTokenizer extends Object
Parses URIs string into tokens and returns reolved URLs as array.

; and : are used as separators. This class is simlar to Ant's PathTokenizer but has 2 important differences:

  • List of URLs instead of Paths
  • This implementation does not take into accout the operating system we are currently running on
Version:
1.0
Author:
Fyodor Kupolov
  • Constructor Details

    • UrlPathTokenizer

      public UrlPathTokenizer(URL baseURL)
  • Method Details

    • split

      public URL[] split(String urls) throws MalformedURLException
      Splits a string with set of URIs into array of URLs resolved relatively to baseURL.
      Parameters:
      urls - not null string with ; or : separated URIs.
      Returns:
      array of resolved URLs.
      Throws:
      MalformedURLException - if urls contain a malformed URI or URL