code: public boolean convert(File source, File destination) {
          boolean result = true;
          if (source.isDirectory()) {
              if (source.getName().startsWith(".")) {
                  // skip "hidden" directories
                  return result;
              }
              if (destination.exists()) {
                  result = result && destination.isDirectory();
              } else {
                  result = result && destination.mkdirs();
              }
              File[] children = source.listFiles();
              for (File element : children) {
                  String inName = element.getName();
                  String outName;
                  if (element.isDirectory()) {
                      outName = inName;
                  } else {
                      outName = inName.substring(0, inName.lastIndexOf('.') + 1)
                              + m_outExt;
                  }
                  result = result && convert(new File(source, inName),
                                             new File(destination, outName));
              }
              return result;
          } else {
              try {
                  if (!source.getName().endsWith("." + m_inExt)) {
                      return result;
                  }
                  InputStream in = new FileInputStream(source);
                  if (!destination.getParentFile().exists()) {
                      destination.getParentFile().mkdirs();
                  }
                  OutputStream out = new FileOutputStream(destination);
                  result = result && convert(in, out);
                  out.close();
                  in.close();
                  return result;
              } catch (IOException e) {
                  return false;
              }
          }
      }
docs: Convert files from one format to the other.
  Hidden directories (directories starting with a ".") are skipped.
  
  @param source
  @param destination
  @return boolean