Package jenkins.scm.api
Class SCMName
- java.lang.Object
-
- jenkins.scm.api.SCMName
-
public final class SCMName extends Object
Utility class to help with naming SCM related things.- Since:
- 2.2.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
fromUrl(String url, String... ignoredPrefixes)
Makes best effort to guess a "sensible" display name from the hostname in the URL.static String
fromUrl(String url, List<String> ignoredPrefixes)
Makes best effort to guess a "sensible" display name from the hostname in the URL.
-
-
-
Method Detail
-
fromUrl
@CheckForNull public static String fromUrl(@NonNull String url, @CheckForNull String... ignoredPrefixes)
Makes best effort to guess a "sensible" display name from the hostname in the URL. For exampleSCMName.fromUrl("https://github.example.com", "github.")
should return"example"
.- Parameters:
url
- the URL.ignoredPrefixes
- the prefixes that should be ignored.- Returns:
- the display name or
null
-
fromUrl
@CheckForNull public static String fromUrl(@NonNull String url, @CheckForNull List<String> ignoredPrefixes)
Makes best effort to guess a "sensible" display name from the hostname in the URL. For exampleSCMName.fromUrl("https://github.example.com", Arrays.asList("github."))
should return"example"
.- Parameters:
url
- the URL.ignoredPrefixes
- the prefixes that should be ignored.- Returns:
- the display name or
null
-
-