public final class PluginManagerUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
appendPathOntoUrl(Object urlString,
Object... pathSection)
Convert object arguments to strings and pass through to the String-ish method to append the path section
onto the base URL string
|
static String |
appendPathOntoUrl(String urlString,
String... pathSection)
Given two strings, concatenate with a single slash at the point they are joined.
|
static String |
dirName(Object urlString)
Convert object arguments to strings and pass through to the String-ish method to remove the last part of the path
from a URL
|
static String |
dirName(String urlString)
Extract the leading part of the URL up to but not including the last section (usually a filename).
|
static String |
removePath(Object urlString)
Convert object arguments to strings and pass through to the String-ish method to remove the entire path part
from a URL
|
static String |
removePath(String urlString)
Remove the path part of a url, if present.
|
static String |
removePossibleWrapperText(String urlText)
Given text loaded from a Jenkins update center, extract just the json content.
Jenkins update centers have meta-data in json form in a file "update-center.json" and, in the case of updates.jenkins.io, another file "update-center.actual.json". |
public static String appendPathOntoUrl(Object urlString, Object... pathSection)
urlString - the first part of a URL as an Object that will be "toString()"ed. (e.g. result of toString() is
http://example.com) Trailing slashes are removed as appropriate. This could be, for example, a
URL object.pathSection - the next parts of a URL to be appended one after another to the first part. (e.g. path/to/file.json)
Leading and trailing slashes are removed as appropriate. Pass in one or more Objects for which
a call to toString() will return the usable String object.appendPathOntoUrl(String, String...)public static String appendPathOntoUrl(String urlString, String... pathSection)
urlString - the first part of a URL. (e.g. http://example.com) Trailing slashes are removed as appropriate.pathSection - the next parts of a URL to be appended one after another to the first part.
(e.g. path/to/file.json) Leading and trailing slashes are removed as appropriate.public static String removePossibleWrapperText(String urlText)
urlText - text loaded from "update-center.json" or "update-center.actual.json"public static String dirName(Object urlString)
urlString - an Object for which toString produces a string containing a url from which to remove the
trailing section. The domain name and port section (that follows the double slash) will not
be removed. This could be, for example, a URL object.dirName(String)public static String dirName(String urlString)
urlString - a string containing a url from which to remove the trailing section.public static String removePath(Object urlString)
urlString - an Object for which toString() will be called to produce a string containing a url from which
to remove the entire path. This could be, for example, a URL object.removePath(String)public static String removePath(String urlString)
urlString - a string containing a url from which to remove the pathCopyright © 2004–2020. All rights reserved.