1 package org.andromda.maven.plugin.andromdapp;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.List;
6 import org.codehaus.plexus.util.DirectoryScanner;
7
8
9
10
11
12
13 public class Location
14 {
15
16
17
18 private String rootPath;
19
20
21
22
23
24
25 public String getRootPath()
26 {
27 return this.rootPath;
28 }
29
30
31
32
33 private String[] includes = new String[] {"**/*.java"};
34
35
36
37
38 private String[] excludes = new String[0];
39
40
41
42
43
44
45 public List<String> getPaths()
46 {
47 final List<String> paths = new ArrayList<String>();
48 if (this.rootPath != null && new File(this.rootPath).exists())
49 {
50 final DirectoryScanner scanner = new DirectoryScanner();
51 scanner.setBasedir(this.rootPath);
52 scanner.setIncludes(this.includes);
53 scanner.setExcludes(this.excludes);
54 scanner.scan();
55
56 for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
57 {
58 paths.add(scanner.getIncludedFiles()[ctr]);
59 }
60 }
61 return paths;
62 }
63 }