code: private ResourceReference computeResourceReference(String rawReference)
      {
          ResourceReference reference;
  
          // Do we have a valid URL?
          Matcher matcher = URL_SCHEME_PATTERN.matcher(rawReference);
          if (matcher.lookingAt()) {
              // We have UC1
              reference = new ResourceReference(rawReference, ResourceType.URL);
          } else {
              // We have UC2
              reference = new ResourceReference(rawReference, ResourceType.PATH);
          }
  
          return reference;
      }
docs: Recognize the passed reference and figure out what type of link it should be:
  <ul>
  <li>UC1: the reference points to a valid URL, we return a reference of type "url",
  e.g. {@code http://server/path/reference#anchor}</li>
  <li>UC2: the reference is not a valid URL, we return a reference of type "path",
  e.g. {@code path/reference#anchor}</li>
  </ul>
  
  @param rawReference the full reference (e.g. "/some/path/something#other")
  @return the properly typed {@link ResourceReference} matching the use cases