提交 b2199a6f 编写于 作者: K kohsuke

added one more method.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2002 71c3de6d-444a-0410-be80-ed276b4c234a
上级 783e9195
......@@ -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.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册