Class RequestPath
- java.lang.Object
-
- com.atlassian.bamboo.plugin.servlet.RequestPath
-
public class RequestPath extends Object
Represents the "path" portion of an HTTP request (as returned byHttpServletRequest.getPathInfo()). Includes utility methods for breaking the path down into its "head" (first component) and "tail" (remainder of the path without the head).
-
-
Constructor Summary
Constructors Constructor Description RequestPath(String pathInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetHead()Returns the first component of the path.StringgetRelativePath()Returns the full path without any leading "/" character.StringgetSegment(int i)Returns the specified zero-based path segment, or an empty string if that segment doesn't exist.intgetSegmentCount()Returns the number of non-empty segments in the path.StringgetTail()Returns the remainder of the path after removing the first component.StringsubPath(int from)Returns the subpath starting at the specified segment (zero-based) and extending to the end of the path.
-
-
-
Constructor Detail
-
RequestPath
public RequestPath(String pathInfo)
-
-
Method Detail
-
getRelativePath
public String getRelativePath()
Returns the full path without any leading "/" character.
-
getHead
public String getHead()
Returns the first component of the path. Does not include any leading or trailing "/" character.
-
getTail
public String getTail()
Returns the remainder of the path after removing the first component. Does not include a leading "/" character. Returns an empty string if the path contains only a single component.
-
subPath
public String subPath(int from)
Returns the subpath starting at the specified segment (zero-based) and extending to the end of the path.
-
getSegmentCount
public int getSegmentCount()
Returns the number of non-empty segments in the path.
-
getSegment
public String getSegment(int i)
Returns the specified zero-based path segment, or an empty string if that segment doesn't exist.
-
-