public class SSCMUtils extends Object
Constructor and Description |
---|
SSCMUtils() |
Modifier and Type | Method and Description |
---|---|
static List<? extends com.cloudbees.plugins.credentials.common.StandardUsernameCredentials> |
availableCredentials(hudson.model.Job<?,?> owner,
String source)
Uses the
CredentialsProvider to lookup StandardUsernameCredentials which will be used to populate
the username // password dropdown box. |
static List<? extends org.jenkinsci.plugins.plaincredentials.FileCredentials> |
availableFileCredentials(hudson.model.Job<?,?> owner,
String source)
Uses the
CredentialsProvider to lookup FileCredentials which will be used to populate
the username // password dropdown box. |
static hudson.util.ListBoxModel |
doFillCredentialsIdItems(hudson.model.Item context,
String remote)
This populates the Username//Password credential dropdown on the config page.
|
static hudson.util.ListBoxModel |
doFillCredentialsItems(hudson.model.Item context,
String remote,
Class credentialType) |
static hudson.util.ListBoxModel |
doFillRsaKeyFileIdItems(hudson.model.Item context,
String remote)
This populates the rsaKeyFileId dropdown with a list of 'FileCredentials' that could be used.
|
static String |
getBranchFromURL(String URL)
Parses the Surround SCM Server port from the pased in sscm:// url.
|
static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
getCredentials(hudson.model.Job<?,?> owner,
hudson.EnvVars env,
String server,
String port,
String credentialsId)
Looks up a specific credential based on the credential ID.
|
static org.jenkinsci.plugins.plaincredentials.FileCredentials |
getFileCredentials(hudson.model.Job<?,?> owner,
hudson.EnvVars env,
String server,
String port,
RSAKey rsaKey)
Looks up a specific file credential based on its ID.
|
static String |
getPortFromURL(String URL)
Parses the Surround SCM Server port from the pased in sscm:// url.
|
static String |
getRepositoryFromURL(String URL)
Parses the Surround SCM Server port from the pased in sscm:// url.
|
static String |
getServerFromURL(String URL)
Parses the Surround SCM Server host name from the passed in sscm:// url.
|
static boolean |
validateSSCMURL(String URL)
Performs basic sscm:// url validation by attempting to match it to the URI_PATTERN variable.
|
static hudson.model.Node |
workspaceToNode(hudson.FilePath workspace)
Helper function which finds the 'Node' for a provided 'workspace'
|
public static String getServerFromURL(String URL)
URL
- ex. sscm://server:4900//branch//Mainline/Path/To/Repositorypublic static String getPortFromURL(String URL)
URL
- ex. sscm://server:4900//branch//Mainline/Path/To/Repositorypublic static String getBranchFromURL(String URL)
URL
- ex. sscm://server:4900//branch//Mainline/Path/To/Repositorypublic static String getRepositoryFromURL(String URL)
URL
- ex. sscm://server:4900//branch//Mainline/Path/To/Repositorypublic static boolean validateSSCMURL(String URL)
URL
- URL to test to see if it is valid.public static hudson.model.Node workspaceToNode(hudson.FilePath workspace)
workspace
- A 'workspace' that was provided by Jenkinspublic static hudson.util.ListBoxModel doFillCredentialsItems(@AncestorInPath hudson.model.Item context, @QueryParameter String remote, @Nonnull Class credentialType)
context
- - Contextremote
- - Remote pathcredentialType
- - Type of credentialspublic static hudson.util.ListBoxModel doFillCredentialsIdItems(@AncestorInPath hudson.model.Item context, @QueryParameter String remote)
context
- - Ownerremote
- - Sourcepublic static hudson.util.ListBoxModel doFillRsaKeyFileIdItems(@AncestorInPath hudson.model.Item context, @QueryParameter String remote)
context
- - Ownerremote
- - Sourcepublic static List<? extends com.cloudbees.plugins.credentials.common.StandardUsernameCredentials> availableCredentials(hudson.model.Job<?,?> owner, String source)
CredentialsProvider
to lookup StandardUsernameCredentials
which will be used to populate
the username // password dropdown box.owner
- Job that this is being performed forsource
- A.... source?StandardUsernameCredentials
which can be thrown into a
StandardUsernameListBoxModel
public static List<? extends org.jenkinsci.plugins.plaincredentials.FileCredentials> availableFileCredentials(hudson.model.Job<?,?> owner, String source)
CredentialsProvider
to lookup FileCredentials
which will be used to populate
the username // password dropdown box.owner
- A.... Jobish object?source
- A.... source?FileCredentials
which can be thrown into a StandardListBoxModel
@CheckForNull public static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentials(hudson.model.Job<?,?> owner, hudson.EnvVars env, String server, String port, String credentialsId)
owner
- Used during credential lookup from the CredentialProviderenv
- Used to generate a 'Source' stringserver
- Used to generate the source stringport
- Used to generate the source stringcredentialsId
- ID string of the credential to lookup.StandardUsernameCredentials
matching the specified credentialsID, or null@CheckForNull public static org.jenkinsci.plugins.plaincredentials.FileCredentials getFileCredentials(hudson.model.Job<?,?> owner, hudson.EnvVars env, String server, String port, RSAKey rsaKey)
owner
- Used during credential lookup from the CredentialProviderenv
- Used to generate a 'Source' stringserver
- Used to generate the source stringport
- Used to generate the source stringrsaKey
- This will only work if this is an rsaKey with a RSAKey.Type
of "ID"RSAKey
'value', or nullCopyright © 2016–2018. All rights reserved.