1 package com.simpligility.maven.plugins.android.common;
2
3 import org.codehaus.plexus.util.DirectoryScanner;
4
5 import java.io.File;
6
7
8
9
10 public final class FileRetriever
11 {
12 private final String[] includes;
13
14
15
16
17
18 public FileRetriever( String... includes )
19 {
20 this.includes = includes;
21 }
22
23
24
25
26
27
28
29
30 public String[] getFileNames( File baseDirectory )
31 {
32 if ( !baseDirectory.exists() )
33 {
34 return new String[ 0 ];
35 }
36
37 final DirectoryScanner directoryScanner = new DirectoryScanner();
38 directoryScanner.setBasedir( baseDirectory );
39 directoryScanner.setIncludes( includes );
40 directoryScanner.addDefaultExcludes();
41 directoryScanner.scan();
42
43 return directoryScanner.getIncludedFiles();
44 }
45 }