Package org.apache.juneau.rest.util
Class UrlPath
java.lang.Object
org.apache.juneau.rest.util.UrlPath
Represents a parsed URL path-info string.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the filename portion of the path if there is one.String[]getParts()Returns the path parts.getPath()Returns the raw path passed into this object.booleanReturnstrue if this path ends with a slash.static UrlPathCreates a new parsedUrlPathobject from the specified string.toString()
-
Method Details
-
of
Creates a new parsedUrlPathobject from the specified string.- Parameters:
path- The path to create. Must benull or or start with '/' per HttpServletRequest.getPathInfo().- Returns:
- A new
UrlPathobject.
-
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.
-
getParts
Returns the path parts.- Returns:
- The path parts.
-
getPath
Returns the raw path passed into this object.- Returns:
- The raw path passed into this object.
-
isTrailingSlash
Returnstrue if this path ends with a slash.- Returns:
true if this path ends with a slash.
-
properties
-
toString
-