Class PathElement

java.lang.Object
com.mastfrog.url.PathElement
All Implemented Interfaces:
URLComponent, Serializable

public final class PathElement extends Object implements URLComponent
One element of a URL's path.
Author:
Tim Boudreau
See Also:
  • Constructor Details

    • PathElement

      public PathElement(String element)
    • PathElement

      public PathElement(String element, boolean trailingSlash)
    • PathElement

      public PathElement(String element, boolean trailingSlash, boolean noEncode)
  • Method Details

    • isValid

      public boolean isValid()
      Description copied from interface: URLComponent
      Determine if this component is in compliance with the RFCs governing URLs and DNS.
      Specified by:
      isValid in interface URLComponent
      Returns:
      True if this component is valid.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getComponentName

      public String getComponentName()
      Description copied from interface: URLComponent
      Get a human-readable, localized name for this part of the URL. Useful if an error message needs to be shown.
      Specified by:
      getComponentName in interface URLComponent
      Returns:
      The component name
    • appendTo

      public void appendTo(StringBuilder sb)
      Description copied from interface: URLComponent
      Append this component to a StringBuilder.
      Specified by:
      appendTo in interface URLComponent
      Parameters:
      sb - A StringBuilder
    • appendTo

      public void appendTo(StringBuilder sb, boolean includeTrailingSlashIfPresent)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isProbableFileReference

      public boolean isProbableFileReference()
    • extension

      public String extension()
    • extensionEquals

      public boolean extensionEquals(String ext)