@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class BlueUrlTokenizer extends Object
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
BlueUrlTokenizer.UrlPart
Enum of URL "parts".
|
| Modifier and Type | Method and Description |
|---|---|
BlueUrlTokenizer.UrlPart |
getLastPart()
Get the last
BlueUrlTokenizer.UrlPart for the URL. |
String |
getPart(BlueUrlTokenizer.UrlPart urlPart) |
boolean |
hasPart(BlueUrlTokenizer.UrlPart urlPart) |
boolean |
lastPartIs(BlueUrlTokenizer.UrlPart urlPart) |
boolean |
lastPartIs(BlueUrlTokenizer.UrlPart urlPart,
String value) |
static BlueUrlTokenizer |
parse(String url)
Parse the supplied URL string and return a
BlueUrlTokenizer instance
iff the URL is a Blue Ocean UI URL. |
static BlueUrlTokenizer |
parseCurrentRequest()
Parse the
current Stapler request and return a BlueUrlTokenizer instance
iff the URL is a Blue Ocean UI URL. |
@CheckForNull public static BlueUrlTokenizer parseCurrentRequest() throws IllegalStateException
current Stapler request and return a BlueUrlTokenizer instance
iff the URL is a Blue Ocean UI URL.BlueUrlTokenizer instance iff the URL is a Blue Ocean UI URL, otherwise null.IllegalStateException - Called outside the scope of an active StaplerRequest.@CheckForNull public static BlueUrlTokenizer parse(@Nonnull String url)
BlueUrlTokenizer instance
iff the URL is a Blue Ocean UI URL.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.BlueUrlTokenizer instance iff the URL is a Blue Ocean UI URL, otherwise null.public boolean hasPart(@Nonnull BlueUrlTokenizer.UrlPart urlPart)
@CheckForNull public String getPart(@Nonnull BlueUrlTokenizer.UrlPart urlPart)
@CheckForNull public BlueUrlTokenizer.UrlPart getLastPart()
BlueUrlTokenizer.UrlPart for the URL.BlueUrlTokenizer.UrlPart for the URL.public boolean lastPartIs(@Nonnull BlueUrlTokenizer.UrlPart urlPart)
public boolean lastPartIs(@Nonnull BlueUrlTokenizer.UrlPart urlPart, @Nonnull String value)
Copyright © 2016–2017. All rights reserved.