Class UrlPath

java.lang.Object
org.apache.juneau.rest.util.UrlPath

public class UrlPath extends Object
Represents a parsed URL path-info string.
See Also:
  • Method Details

    • of

      public static UrlPath of(String path)
      Creates a new parsed UrlPath object from the specified string.
      Parameters:
      path - The path to create. Must be null or or start with '/' per HttpServletRequest.getPathInfo().
      Returns:
      A new UrlPath object.
    • getParts

      public String[] getParts()
      Returns the path parts.
      Returns:
      The path parts.
    • getFileName

      Returns the filename portion of the path if there is one.

      For example, given the path "/foo/bar.txt", this returns "bar.txt".

      Returns:
      The filename portion of the path, or null if the path doesn't match a file name.
    • getPath

      public String getPath()
      Returns the raw path passed into this object.
      Returns:
      The raw path passed into this object.
    • isTrailingSlash

      public boolean isTrailingSlash()
      Returns true if this path ends with a slash.
      Returns:
      true if this path ends with a slash.
    • toString

      public String toString()
      Overrides:
      toString in class Object