code: private boolean resourceExists(CmsObject cms, String resource) {
  
          try {
              cms.readResource(resource, CmsResourceFilter.ALL);
              return true;
          } catch (CmsException e) {
              return false;
          }
      }
docs: Checks if a resource with a given name exits in the VFS.<p>
  
  @param cms the current cms context
  @param resource the resource to check for
  
  @return true if the resource exists in the VFS