code: private static String recursiveSearch(java.io.File dir, String fileName) {
          for (String name : dir.list()) {
              java.io.File file = new java.io.File(dir.getAbsolutePath() + "/" + name);
              if (name.compareTo(fileName) == 0) return file.getAbsolutePath();
              if (file.isDirectory()) {
                  String filePath = recursiveSearch(file, fileName);
                  if (filePath != null) return filePath;
              }
          }
  
          return null;
      }
docs: Recursive method for searching file path.
  
  @param dir
  @param fileName
  @return