code: private Link parseLinkHeader(final String link) throws ExternalMessageBodyException {
          final Link realLink = Link.valueOf(link);
  
          try {
              final String handling = realLink.getParams().get(HANDLING);
              if (handling == null || !handling.matches("(?i)" + PROXY + "|" + COPY + "|" + REDIRECT)) {
                  // error
                  throw new ExternalMessageBodyException(
                          "Link header formatted incorrectly: 'handling' parameter incorrect or missing");
              }
          } catch (final Exception e) {
              throw new ExternalMessageBodyException("External content link header url is malformed");
          }
          return realLink;
      }
docs: Validate that an external content link header is appropriately formatted
  @param link to be validated
  @return Link object if the header is formatted correctly, else null
  @throws ExternalMessageBodyException on error