code: private boolean folderExists(CmsObject cms, String folder) {
  
          try {
              CmsFolder test = cms.readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
              if (test.isFile()) {
                  return false;
              }
              return true;
          } catch (Exception e) {
              return false;
          }
      }
docs: Checks if a folder with a given name exits in the VFS.<p>
  
  @param cms the current cms context
  @param folder the folder to check for
  @return true if the folder exists in the VFS