public boolean isWildCardMediaType() { return WILDCARD_ANY.getType().equals(this.type) && WILDCARD_ANY.getSubType().equals(this.subType); }
public boolean isWildCardMediaType() { return WILDCARD_ANY.getType().equals(this.type) && WILDCARD_ANY.getSubType().equals(this.subType); }
private Map<String, String> buildRenderedData(ProcessorResult result) throws ODataException { LOG.debug("Start to render the data"); Map<String, String> resultMap = new HashMap<>(); if (result.getStatus().getCode() < ODataResponse.Status.NO_CONTENT.getCode()) { String contentType = result.getHeaders().get(CONTENT_TYPE); if (!result.getHeaders().containsKey(CONTENT_TYPE) || contentType.startsWith(MediaType.ATOM_XML.toString())) { // render XML resultMap.put(FORMAT, MediaType.ATOM_XML.toString()); resultMap.put(BODY, getRenderedXML(result)); } else if (contentType.startsWith(MediaType.JSON.toString())) { // render JSON resultMap.put(FORMAT, MediaType.JSON.toString()); resultMap.put(BODY, getRenderedJSON(result)); } } else { resultMap.put(FORMAT, MediaType.HTTP.getSubType()); resultMap.put(BODY, (String) result.getData()); } return resultMap; }
private Map<String, String> buildRenderedData(ProcessorResult result) throws ODataException { LOG.debug("Start to render the data"); Map<String, String> resultMap = new HashMap<>(); if (result.getStatus().getCode() < ODataResponse.Status.NO_CONTENT.getCode()) { String contentType = result.getHeaders().get(CONTENT_TYPE); if (!result.getHeaders().containsKey(CONTENT_TYPE) || contentType.startsWith(MediaType.ATOM_XML.toString())) { // render XML resultMap.put(FORMAT, MediaType.ATOM_XML.toString()); resultMap.put(BODY, getRenderedXML(result)); } else if (contentType.startsWith(MediaType.JSON.toString())) { // render JSON resultMap.put(FORMAT, MediaType.JSON.toString()); resultMap.put(BODY, getRenderedJSON(result)); } } else { resultMap.put(FORMAT, MediaType.HTTP.getSubType()); resultMap.put(BODY, (String) result.getData()); } return resultMap; }