Package io.jenkins.blueocean.preload
Class BlueUrlTokenizer
java.lang.Object
io.jenkins.blueocean.preload.BlueUrlTokenizer
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class BlueUrlTokenizer
extends Object
General purpose Blue Ocean UI URL parser.
This class performs a "best effort" attempt to parse a URL as a Blue Ocean
URL, extracting what it thinks are the relevant "parts" and making available via the
getPart(UrlPart)
and hasPart(UrlPart)
functions.
See TBD comment on BlueUrlTokenizer.UrlPart
.
- Author:
- tom.fennelly@gmail.com
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the lastBlueUrlTokenizer.UrlPart
for the URL.getPart
(BlueUrlTokenizer.UrlPart urlPart) boolean
hasPart
(BlueUrlTokenizer.UrlPart urlPart) boolean
lastPartIs
(BlueUrlTokenizer.UrlPart urlPart) boolean
lastPartIs
(BlueUrlTokenizer.UrlPart urlPart, String value) static BlueUrlTokenizer
Parse the supplied URL string and return aBlueUrlTokenizer
instance iff the URL is a Blue Ocean UI URL.static BlueUrlTokenizer
Parse thecurrent Stapler request
and return aBlueUrlTokenizer
instance iff the URL is a Blue Ocean UI URL.
-
Method Details
-
parseCurrentRequest
Parse thecurrent Stapler request
and return aBlueUrlTokenizer
instance iff the URL is a Blue Ocean UI URL.- Returns:
- A
BlueUrlTokenizer
instance iff the URL is a Blue Ocean UI URL, otherwisenull
. - Throws:
IllegalStateException
- Called outside the scope of an activeStaplerRequest
.
-
parse
Parse the supplied URL string and return aBlueUrlTokenizer
instance iff the URL is a Blue Ocean UI URL.- Parameters:
url
- The URL to be parsed. The URL must not be decoded in any way, so as to ensure that no URL component data is lost.- Returns:
- A
BlueUrlTokenizer
instance iff the URL is a Blue Ocean UI URL, otherwisenull
.
-
hasPart
-
getPart
-
getLastPart
Get the lastBlueUrlTokenizer.UrlPart
for the URL.- Returns:
- The last
BlueUrlTokenizer.UrlPart
for the URL.
-
lastPartIs
-
lastPartIs
-