code: private List<String> scanFileSet(File sourceDirectory, FileSet fileSet) {
          final String[] emptyStringArray = {};
  
          DirectoryScanner scanner = new DirectoryScanner();
  
          scanner.setBasedir(sourceDirectory);
          if (fileSet.getIncludes() != null && !fileSet.getIncludes().isEmpty()) {
              scanner.setIncludes(fileSet.getIncludes().toArray(emptyStringArray));
          } else {
              scanner.setIncludes(DEFAULT_INCLUDES);
          }
  
          if (fileSet.getExcludes() != null && !fileSet.getExcludes().isEmpty()) {
              scanner.setExcludes(fileSet.getExcludes().toArray(emptyStringArray));
          }
  
          if (fileSet.isUseDefaultExcludes()) {
              scanner.addDefaultExcludes();
          }
  
          scanner.scan();
  
          return Arrays.asList(scanner.getIncludedFiles());
      }
docs: Scan a fileset and get a list of files which it contains.
  
  @param fileset
  @return list of files contained within a fileset.
  @throws FileNotFoundException