mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-09 10:06:13 +00:00
added one more method.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2002 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
783e9195cc
commit
b2199a6f55
1 file changed
+25
@@ -412,6 +412,31 @@ public final class FilePath implements Serializable {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* List up files in this directory that matches the given Ant-style filter.
|
||||
*
|
||||
* @param includes
|
||||
* See {@link FileSet} for the syntax. String like "foo/*.zip".
|
||||
*/
|
||||
public FilePath[] list(final String includes) throws IOException, InterruptedException {
|
||||
return act(new FileCallable<FilePath[]>() {
|
||||
public FilePath[] invoke(File f, VirtualChannel channel) throws IOException {
|
||||
FileSet fs = new FileSet();
|
||||
fs.setDir(f);
|
||||
fs.setIncludes(includes);
|
||||
|
||||
DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project());
|
||||
String[] files = ds.getIncludedFiles();
|
||||
|
||||
FilePath[] r = new FilePath[files.length];
|
||||
for( int i=0; i<r.length; i++ )
|
||||
r[i] = new FilePath(new File(f,files[i]));
|
||||
|
||||
return r;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads this file.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user