code: private boolean isValidOpenPath(CmsObject cms, String openPath) {
  
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(openPath)) {
              return false;
          }
          if (!cms.existsResource(openPath)) {
              // in case of a detail-page check the parent folder
              String parent = CmsResource.getParentFolder(openPath);
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(parent) || !cms.existsResource(parent)) {
                  return false;
              }
          }
          return true;
      }
docs: Checks if the given open path is valid.<p>
  
  @param cms the cms context
  @param openPath the open path
  
  @return <code>true</code> if the given open path is valid