Class FileFinder

java.lang.Object
jenkins.MasterToSlaveFileCallable<String[]>
io.jenkins.plugins.analysis.core.util.FileFinder
All Implemented Interfaces:
FilePath.FileCallable<String[]>, Serializable, org.jenkinsci.remoting.RoleSensitive

public class FileFinder extends MasterToSlaveFileCallable<String[]>
Scans the workspace and finds all files matching a given ant pattern.
Author:
Ullrich Hafner
See Also:
  • Constructor Details

    • FileFinder

      public FileFinder(String includesPattern)
      Creates a new instance of FileFinder.
      Parameters:
      includesPattern - the ant file includes pattern to scan for
    • FileFinder

      public FileFinder(String includesPattern, String excludesPattern)
      Creates a new instance of FileFinder.
      Parameters:
      includesPattern - the ant file includes pattern to scan for
      excludesPattern - the ant file excludes pattern to scan for
    • FileFinder

      public FileFinder(String includesPattern, String excludesPattern, boolean followSymlinks)
      Creates a new instance of FileFinder.
      Parameters:
      includesPattern - the ant file includes pattern to scan for
      excludesPattern - the ant file excludes pattern to scan for
      followSymlinks - if the scanner should traverse symbolic links
  • Method Details

    • invoke

      public String[] invoke(File workspace, hudson.remoting.VirtualChannel channel) throws IOException
      Returns an array with the file names of the specified file pattern that have been found in the workspace.
      Parameters:
      workspace - root directory of the workspace
      channel - not used
      Returns:
      the file names of all found files
      Throws:
      IOException - if the workspace could not be read
    • find

      public String[] find(File workspace)
      Returns an array with the file names of the specified file pattern that have been found in the workspace.
      Parameters:
      workspace - root directory of the workspace
      Returns:
      the file names of all found files