public class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
getFeatureFileNamesFromWorkspace(hudson.FilePath workspace,
String path,
hudson.model.TaskListener listener)
This method will return all files with the ".feature" extension within a given build workspace and a path.
|
static List<hudson.FilePath> |
getFeatureFilesFromWorkspace(hudson.FilePath workspace,
String path,
hudson.model.TaskListener listener)
Utility method that returns all .features files from a folder, including those contained in sub folders.
|
static List<hudson.FilePath> |
getFiles(hudson.FilePath workspace,
String globExpression,
hudson.model.TaskListener listener)
Returns a list of files that matches the glob expression relatively to the workspace or that matches a file path.
|
static hudson.FilePath |
readFile(hudson.FilePath workspace,
String filePath,
hudson.model.TaskListener listener)
Given the Jenkins project workspace FilePath and the file path, will resolve the FilePath of the file
|
public static List<hudson.FilePath> getFeatureFilesFromWorkspace(hudson.FilePath workspace, String path, hudson.model.TaskListener listener) throws IOException, InterruptedException
workspace - the Jenkins project workspacepath - the folder pathlistener - the TaskListenerIOExceptionInterruptedExceptionpublic static Set<String> getFeatureFileNamesFromWorkspace(hudson.FilePath workspace, String path, hudson.model.TaskListener listener) throws IOException, InterruptedException
workspace - the build's workspacepath - the relative or absolute path where to search for the feature fileslistener - the lostener used to write some logsIOException - Exception thrown when file/directory reading the operation failsInterruptedException - Exception thrown when file/directory reading the operation failspublic static List<hudson.FilePath> getFiles(hudson.FilePath workspace, String globExpression, hudson.model.TaskListener listener) throws IOException, InterruptedException
workspace - the workspaceglobExpression - the glob expression. Must be relative to the workspaceIOExceptionInterruptedExceptionpublic static hudson.FilePath readFile(hudson.FilePath workspace,
String filePath,
hudson.model.TaskListener listener)
workspace - the Jenkins workspacefilePath - the file path of the filelistener - the task listenerFilePathCopyright © 2016–2020. All rights reserved.