Class Utils
java.lang.Object
io.jenkins.plugins.artifactory_artifacts.Utils
-
Method Summary
Modifier and TypeMethodDescriptionReturn the artifactory config or null if not configuredstatic com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
Get the credentials or null if not configuredstatic com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
getCredentials
(String credentialsId) static String
getFilePath
(String key, String path) Get the path with the prefixstatic String
Get the path with the prefixstatic String
Get the URL of the artifactstatic String
stripTrailingSlash
(String key) Strip the trailing slash
-
Method Details
-
getArtifactConfig
Return the artifactory config or null if not configured- Returns:
- the artifactory config or null if not configured
-
getCredentials
@Nullable public static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials getCredentials()Get the credentials or null if not configured- Returns:
- the credentials or null if not configured
-
getCredentials
public static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials getCredentials(String credentialsId) -
getCredentials
public static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials getCredentials(ArtifactoryGenericArtifactConfig config) -
getUrl
Get the URL of the artifact- Parameters:
name
- the name of the artifact- Returns:
- the URL of the artifact
-
stripTrailingSlash
Strip the trailing slash- Parameters:
key
- the key- Returns:
- the key without the trailing slash
-
getFilePath
Get the path with the prefix- Parameters:
key
- the keypath
- the path- Returns:
- the path with the prefix
-
getPath
Get the path with the prefix- Parameters:
prefix
- the prefix. Can be null or empty. Must end with a slash if not empty.filePath
- the file path- Returns:
- the path with the prefix
-