Package org.apache.juneau.rest.util
Class UrlPath
java.lang.Object
org.apache.juneau.rest.util.UrlPath
Represents a parsed URL path-info string.
See Also:
-
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.boolean
Returnstrue if this path ends with a slash.static UrlPath
Creates a new parsedUrlPath
object from the specified string.toString()
-
Method Details
-
of
Creates a new parsedUrlPath
object from the specified string.- Parameters:
path
- The path to create. Must benull or or start with '/' per HttpServletRequest.getPathInfo().- Returns:
- A new
UrlPath
object.
-
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
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.
-
toString
-