code: private String[] getFilesToCopy(Resource resource) {
      DirectoryScanner scanner = new DirectoryScanner();
      scanner.setBasedir(resource.getDirectory());
      if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
        scanner.setIncludes(resource.getIncludes().toArray(new String[0]));
      }
      else {
        scanner.setIncludes(DEFAULT_INCLUDES);
      }
      if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
        scanner.setExcludes(resource.getExcludes().toArray(new String[0]));
      }
  
      scanner.addDefaultExcludes();
  
      scanner.scan();
  
      return scanner.getIncludedFiles();
    }
docs: Taken from war plugin.
  
  @param resource
  @return array of file names that would be copied from specified resource