/** * Returns whether this content type is match by the content type found in the * "Accept" header field of an HTTP request. * * <p>For atom content type, this method will check the optional attribute * 'type'. If the type attribute is set in both this and {@code * acceptedContentType}, then they must be the same. That is, {@code * application/atom+xml} will match both {@code * application/atom+xml;type=feed} and {@code * application/atom+xml;type=entry}, but {@code * application/atom+xml;type=entry} will not match {@code * application/atom+xml;type=feed}.a * * @param acceptedContentType content type found in the "Accept" header field * of an HTTP request */ public boolean match(ContentType acceptedContentType) { String acceptedType = acceptedContentType.getType(); String acceptedSubType = acceptedContentType.getSubType(); return STAR.equals(acceptedType) || type.equals(acceptedType) && (STAR.equals(acceptedSubType) || subType.equals(acceptedSubType)) && (!isAtom() || matchAtom(acceptedContentType)); }
/** * Returns whether this content type is match by the content type found in the * "Accept" header field of an HTTP request. * * <p>For atom content type, this method will check the optional attribute * 'type'. If the type attribute is set in both this and {@code * acceptedContentType}, then they must be the same. That is, {@code * application/atom+xml} will match both {@code * application/atom+xml;type=feed} and {@code * application/atom+xml;type=entry}, but {@code * application/atom+xml;type=entry} will not match {@code * application/atom+xml;type=feed}.a * * @param acceptedContentType content type found in the "Accept" header field * of an HTTP request */ public boolean match(ContentType acceptedContentType) { String acceptedType = acceptedContentType.getType(); String acceptedSubType = acceptedContentType.getSubType(); return STAR.equals(acceptedType) || type.equals(acceptedType) && (STAR.equals(acceptedSubType) || subType.equals(acceptedSubType)) && (!isAtom() || matchAtom(acceptedContentType)); }
/** * Returns whether this content type is match by the content type found in the * "Accept" header field of an HTTP request. * * <p>For atom content type, this method will check the optional attribute * 'type'. If the type attribute is set in both this and {@code * acceptedContentType}, then they must be the same. That is, {@code * application/atom+xml} will match both {@code * application/atom+xml;type=feed} and {@code * application/atom+xml;type=entry}, but {@code * application/atom+xml;type=entry} will not match {@code * application/atom+xml;type=feed}.a * * @param acceptedContentType content type found in the "Accept" header field * of an HTTP request */ public boolean match(ContentType acceptedContentType) { String acceptedType = acceptedContentType.getType(); String acceptedSubType = acceptedContentType.getSubType(); return STAR.equals(acceptedType) || type.equals(acceptedType) && (STAR.equals(acceptedSubType) || subType.equals(acceptedSubType)) && (!isAtom() || matchAtom(acceptedContentType)); }