/** * Is the given type a FHIR legacy (pre-DSTU3) content type? */ public static boolean isLegacy(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return false; } else { return ourContentTypeToEncodingLegacy.containsKey(contentTypeSplitted); } }
/** * Returns the encoding for a given content type, or <code>null</code> if no encoding * is found. * <p> * <b>This method is lenient!</b> Things like "application/xml" will return {@link EncodingEnum#XML} * even if the "+fhir" part is missing from the expected content type. * </p> */ public static EncodingEnum forContentType(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return null; } else { return ourContentTypeToEncoding.get(contentTypeSplitted ); } }
/** * Returns the encoding for a given content type, or <code>null</code> if no encoding * is found. * <p> * <b>This method is NOT lenient!</b> Things like "application/xml" will return <code>null</code> * </p> * * @see #forContentType(String) */ public static EncodingEnum forContentTypeStrict(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return null; } else { return ourContentTypeToEncodingStrict.get(contentTypeSplitted); } }
/** * Is the given type a FHIR legacy (pre-DSTU3) content type? */ public static boolean isLegacy(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return false; } else { return ourContentTypeToEncodingLegacy.containsKey(contentTypeSplitted); } }
/** * Returns the encoding for a given content type, or <code>null</code> if no encoding * is found. * <p> * <b>This method is NOT lenient!</b> Things like "application/xml" will return <code>null</code> * </p> * * @see #forContentType(String) */ public static EncodingEnum forContentTypeStrict(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return null; } else { return ourContentTypeToEncodingStrict.get(contentTypeSplitted); } }
/** * Returns the encoding for a given content type, or <code>null</code> if no encoding * is found. * <p> * <b>This method is lenient!</b> Things like "application/xml" will return {@link EncodingEnum#XML} * even if the "+fhir" part is missing from the expected content type. * </p> */ public static EncodingEnum forContentType(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return null; } else { return ourContentTypeToEncoding.get(contentTypeSplitted ); } }