@Test public void testValidateContentTypeApplicationHTTP() throws BatchException { List<String> contentTypeValues = Arrays.asList(new String[] { HttpContentType.APPLICATION_HTTP }); final Header headers = makeHeaders(HttpHeaders.CONTENT_TYPE, contentTypeValues); BatchTransformatorCommon.validateContentType(headers); }
public static void validateContentType(final Header headers) throws BatchException { List<String> contentTypes = headers.getHeaders(HttpHeaders.CONTENT_TYPE); if (contentTypes.isEmpty()) { throw new BatchException(BatchException.MISSING_CONTENT_TYPE); } if (!headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_MULTIPART_MIXED) && !headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_CONTENT_TYPE_APPLICATION_HTTP)) { throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent( HttpContentType.MULTIPART_MIXED + " or " + HttpContentType.APPLICATION_HTTP)); } }
BatchTransformatorCommon { public static void validateContentType(final Header headers) throws BatchException { List<String> contentTypes = headers.getHeaders(HttpHeaders.CONTENT_TYPE); if (contentTypes.isEmpty()) { throw new BatchException(BatchException.MISSING_CONTENT_TYPE); } if (!headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_MULTIPART_MIXED) && !headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_CONTENT_TYPE_APPLICATION_HTTP)) { throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent( HttpContentType.MULTIPART_MIXED + " or " + HttpContentType.APPLICATION_HTTP)); } } }
BatchTransformatorCommon { public static void validateContentType(final Header headers) throws BatchException { List<String> contentTypes = headers.getHeaders(HttpHeaders.CONTENT_TYPE); if (contentTypes.isEmpty()) { throw new BatchException(BatchException.MISSING_CONTENT_TYPE); } if (!headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_MULTIPART_MIXED) && !headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_CONTENT_TYPE_APPLICATION_HTTP)) { throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent( HttpContentType.MULTIPART_MIXED + " or " + HttpContentType.APPLICATION_HTTP)); } }  }
BatchTransformatorCommon { public static void validateContentType(final Header headers) throws BatchException { List<String> contentTypes = headers.getHeaders(HttpHeaders.CONTENT_TYPE); if (contentTypes.isEmpty()) { throw new BatchException(BatchException.MISSING_CONTENT_TYPE); } if (!headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_MULTIPART_MIXED) && !headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_CONTENT_TYPE_APPLICATION_HTTP)) { throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent( HttpContentType.MULTIPART_MIXED + " or " + HttpContentType.APPLICATION_HTTP)); } }  static void validateContentType(final Header headers); static void validateContentTransferEncoding(final Header headers, final boolean isChangeRequest); static int getContentLength(final Header headers); static void validateHost(final Header headers, final String baseUri); }
BatchTransformatorCommon { public static void validateContentType(final Header headers) throws BatchException { List<String> contentTypes = headers.getHeaders(HttpHeaders.CONTENT_TYPE); if (contentTypes.isEmpty()) { throw new BatchException(BatchException.MISSING_CONTENT_TYPE); } if (!headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_MULTIPART_MIXED) && !headers.isHeaderMatching(HttpHeaders.CONTENT_TYPE, BatchParserCommon.PATTERN_CONTENT_TYPE_APPLICATION_HTTP)) { throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent( HttpContentType.MULTIPART_MIXED + " or " + HttpContentType.APPLICATION_HTTP)); } }  static void validateContentType(final Header headers); static void validateContentTransferEncoding(final Header headers, final boolean isChangeRequest); static int getContentLength(final Header headers); static void validateHost(final Header headers, final String baseUri);  }