code: private static void getFilesByExtensionRecursive(Collection<Media> filesList, Media path, String extension)
      {
          for (final Media content : path.getMedias())
          {
              if (extension.equals(UtilFile.getExtension(content.getPath())))
              {
                  filesList.add(content);
              }
          }
      }
docs: Get all files existing in the path considering the extension.
  
  @param filesList The files list.
  @param path The path to check.
  @param extension The extension (without dot; eg: png).