java.lang.Object
io.jenkins.plugins.artifactory_artifacts.Utils

public final class Utils extends Object
  • Method Details

    • getArtifactConfig

      @Nullable public static ArtifactoryGenericArtifactConfig 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

      public static String getUrl(String name)
      Get the URL of the artifact
      Parameters:
      name - the name of the artifact
      Returns:
      the URL of the artifact
    • stripTrailingSlash

      public static String stripTrailingSlash(String key)
      Strip the trailing slash
      Parameters:
      key - the key
      Returns:
      the key without the trailing slash
    • getFilePath

      public static String getFilePath(String key, String path)
      Get the path with the prefix
      Parameters:
      key - the key
      path - the path
      Returns:
      the path with the prefix
    • getPath

      @NonNull public static String getPath(String prefix, @NonNull Path filePath)
      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