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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionGet the lastBlueUrlTokenizer.UrlPartfor the URL.getPart(BlueUrlTokenizer.UrlPart urlPart) booleanhasPart(BlueUrlTokenizer.UrlPart urlPart) booleanlastPartIs(BlueUrlTokenizer.UrlPart urlPart) booleanlastPartIs(BlueUrlTokenizer.UrlPart urlPart, String value) static BlueUrlTokenizerParse the supplied URL string and return aBlueUrlTokenizerinstance iff the URL is a Blue Ocean UI URL.static BlueUrlTokenizerParse thecurrent Stapler requestand return aBlueUrlTokenizerinstance iff the URL is a Blue Ocean UI URL.
-
Method Details
-
parseCurrentRequest
Parse thecurrent Stapler requestand return aBlueUrlTokenizerinstance iff the URL is a Blue Ocean UI URL.- Returns:
- A
BlueUrlTokenizerinstance iff the URL is a Blue Ocean UI URL, otherwisenull. - Throws:
IllegalStateException- Called outside the scope of an activeStaplerRequest2.
-
parse
Parse the supplied URL string and return aBlueUrlTokenizerinstance 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
BlueUrlTokenizerinstance iff the URL is a Blue Ocean UI URL, otherwisenull.
-
hasPart
-
getPart
-
getLastPart
Get the lastBlueUrlTokenizer.UrlPartfor the URL.- Returns:
- The last
BlueUrlTokenizer.UrlPartfor the URL.
-
lastPartIs
-
lastPartIs
-