Class URLParser

java.lang.Object
org.deltava.util.URLParser

public class URLParser extends Object
A utility class to parse URLs.
Since:
1.0
Version:
10.3
Author:
Luke
  • Constructor Details

    • URLParser

      public URLParser(String rawURL)
      Initializes the object and parses the URL.
      Parameters:
      rawURL - the URL to parse
  • Method Details

    • getExtension

      public String getExtension()
      Returns the file extension.
      Returns:
      the extension
    • getFileName

      public String getFileName()
      Returns the file name and extension.
      Returns:
      the filename + extension
    • getName

      public String getName()
      Returns the file name, minus extension.
      Returns:
      the file name
    • getPath

      public LinkedList<String> getPath()
      Returns the path entries.
      Returns:
      a LinkedList of path entries
    • getFirstPath

      public String getFirstPath()
      Returns the first directory element.
      Returns:
      the first element , or an empty string if not present
    • getLastPath

      public String getLastPath()
      Returns the last directory element.
      Returns:
      the last element before the file name, or an empty string if not present
    • containsPath

      public boolean containsPath(String path)
      Returns if the URL contains a particular path entry.
      Parameters:
      path - the path entry to search for
      Returns:
      TRUE if the URL contains the path, otherwise FALSE
    • size

      public int size()
      Returns the number of elements in the URL.
      Returns:
      the number of elements