开发者

How to get a list of all files in Ant FileSet

开发者 https://www.devze.com 2022-12-29 15:13 出处:网络
I\'m writing an custom ant task in java. I would like to get a list of all the files wit开发者_StackOverflow中文版hin a FileSet. What is the best way to do this?Have a look at the example from Tutoria

I'm writing an custom ant task in java. I would like to get a list of all the files wit开发者_StackOverflow中文版hin a FileSet. What is the best way to do this?


Have a look at the example from Tutorial: Tasks using Properties, Filesets & Paths:

FileSet fs;
// ...
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
String[] includedFiles = ds.getIncludedFiles();
for(int i=0; i<includedFiles.length; i++) {
    String filename = includedFiles[i].replace('\\','/');
    ...
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号