code: public static boolean isResourceTypeIdFree(int id) {
  
          try {
              OpenCms.getResourceManager().getResourceType(id);
          } catch (CmsLoaderException e) {
              return true;
          }
          return false;
      }
docs: Is the given resource type id free?
  @param id to be checked
  @return boolean