public class StorageUtil extends Object
Constructor and Description |
---|
StorageUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getRelative(FilePath include,
FilePath workspace)
Compute the relative path of the given file inclusion, relative to the given workspace.
|
static String |
getStrippedFilename(String filename,
String pathPrefix)
If a path prefix to strip has been specified, and the input string starts with that prefix,
returns the portion of the input after that prefix.
|
static com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials |
lookupCredentials(String credentials)
Look up credentials by name.
|
static String |
replaceMacro(String name,
Run<?,?> run,
TaskListener listener)
Perform variable expansion for non-pipeline steps.
|
public static String getRelative(FilePath include, FilePath workspace) throws UploadException
include
- The file whose relative path we are computing.workspace
- The workspace containing the included file.UploadException
- when the input is malformedpublic static String getStrippedFilename(String filename, String pathPrefix)
filename
- Input string to strip.pathPrefix
- Name of the path prefix to strip on.public static String replaceMacro(String name, Run<?,?> run, TaskListener listener) throws InterruptedException, IOException
name
- The name, potentially including with variablesrun
- The current run, used to determine pipeline status and to get environment.listener
- Task listener, used to get environmentInterruptedException
- If getting the environment of the run throws an
InterruptedException.IOException
- If getting the environment of the run throws an IOException.public static com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials lookupCredentials(String credentials) throws AbortException
credentials
- The name of the credentials to look up.GoogleRobotCredentials
.AbortException
- If credentials not found.Copyright © 2016–2019. All rights reserved.