code: public static String searchWebInfFolder(String startFolder) {
  
          if (CmsStringUtil.isEmpty(startFolder)) {
              return null;
          }
  
          File f = new File(startFolder);
          if (!f.exists() || !f.isDirectory()) {
              return null;
          }
  
          File configFile = new File(f, CmsSystemInfo.FILE_TLD);
          if (configFile.exists() && configFile.isFile()) {
              return f.getAbsolutePath();
          }
  
          String webInfFolder = null;
          File[] subFiles = f.listFiles();
          List<File> fileList = new ArrayList<File>(Arrays.asList(subFiles));
          Collections.sort(fileList, new Comparator<File>() {
  
              public int compare(File arg0, File arg1) {
  
                  // make sure that the WEB-INF folder, if it has that name, comes earlier
                  boolean a = arg0.getPath().contains("WEB-INF");
                  boolean b = arg1.getPath().contains("WEB-INF");
                  return Boolean.valueOf(b).compareTo(Boolean.valueOf(a));
  
              }
          });
  
          for (File file : fileList) {
              if (file.isDirectory()) {
                  webInfFolder = searchWebInfFolder(file.getAbsolutePath());
                  if (webInfFolder != null) {
                      break;
                  }
              }
          }
  
          return webInfFolder;
      }
docs: Searches for the OpenCms web application 'WEB-INF' folder during system startup, code or
  <code>null</code> if the 'WEB-INF' folder can not be found.<p>
  
  @param startFolder the folder where to start searching
  
  @return String the path of the 'WEB-INF' folder in the 'real' file system, or <code>null</code>