hudson.plugins.analysis.util
Class FileFinder

java.lang.Object
  extended by hudson.plugins.analysis.util.FileFinder
All Implemented Interfaces:
hudson.FilePath.FileCallable<String[]>, Serializable

public class FileFinder
extends Object
implements hudson.FilePath.FileCallable<String[]>

Scans the workspace and finds all files matching a give pattern.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
FileFinder()
          Creates a new instance of FileFinder.
FileFinder(String pattern)
          Creates a new instance of FileFinder.
 
Method Summary
 String[] find(File workspace)
          Returns an array with the filenames of the specified file pattern that have been found in the workspace.
 String[] invoke(File workspace, hudson.remoting.VirtualChannel channel)
          Returns an array with the filenames of the specified file pattern that have been found in the workspace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFinder

public FileFinder()
Creates a new instance of FileFinder. This instance will scan for Java files, see JAVA_PATTERN.


FileFinder

public FileFinder(String pattern)
Creates a new instance of FileFinder.

Parameters:
pattern - the ant file pattern to scan for
Method Detail

invoke

public String[] invoke(File workspace,
                       hudson.remoting.VirtualChannel channel)
                throws IOException
Returns an array with the filenames of the specified file pattern that have been found in the workspace.

Specified by:
invoke in interface hudson.FilePath.FileCallable<String[]>
Parameters:
workspace - root directory of the workspace
channel - not used
Returns:
the filenames of all found files
Throws:
IOException - if the workspace could not be read

find

public String[] find(File workspace)
Returns an array with the filenames of the specified file pattern that have been found in the workspace.

Parameters:
workspace - root directory of the workspace
Returns:
the filenames of all found files


Copyright © 2004-2012 Hudson. All Rights Reserved.