1

How do I parse paths such as /aaa/bbb/**/*.java as used in ant. I guess I could have looked into the source code. Is there is simple solution.

fastcodejava
  • 39,895
  • 28
  • 133
  • 186

3 Answers3

4

You can use Ant's DirectoryScanner.

Community
  • 1
  • 1
limc
  • 39,366
  • 20
  • 100
  • 145
  • I figured there should be a way to use ant. I guess I was a bit lazy to actually research the class available to do the same. :) – gbvb Jan 23 '11 at 15:38
0

You could use String.split() to split on the path separator character. You could then iterate through the resulting array to descend through the directory tree.

pwc
  • 7,043
  • 3
  • 29
  • 32
0

I wonder if you might be able to use ant itself for that.. Check out How to parse and interpret ant's build.xml. It shows how to get the path used by ant. I am not sure what you are looking to do..

Community
  • 1
  • 1
gbvb
  • 866
  • 5
  • 10