code: public static void validateRepoName(String name) {
          if (name.isEmpty()) {
              throw new InvalidRepositoryNameException(String.format("Invalid empty repository name \"%s\"", name));
          }
  
          if (name.length() > RepositoryNameTotalLengthMax) {
              throw new InvalidRepositoryNameException(String.format("Repository name \"%s\" is longer than "
                      + RepositoryNameTotalLengthMax, name));
          }
  
          String[] components = name.split("/");
  
          for (String component : components) {
              if (!RepositoryNameComponentAnchoredRegexp.matcher(component).matches()) {
                  throw new InvalidRepositoryNameException(String.format(
                          "Repository name \"%s\" is invalid. Component: %s", name, component));
              }
          }
      }
docs: /*
  see https://github.com/docker/distribution/blob/master/registry/api/v2/names.go