@Test public void testIsTextContentType() { Assert.assertTrue(HttpUtilities.isTextContentType("application/json")); Assert.assertTrue(HttpUtilities.isTextContentType("text/javascript")); Assert.assertTrue(HttpUtilities.isTextContentType("text/x-javascript")); Assert.assertTrue(HttpUtilities.isTextContentType("text/x-json")); Assert.assertTrue(HttpUtilities.isTextContentType("text/html")); Assert.assertTrue(HttpUtilities.isTextContentType("application/xhtml+xml")); Assert.assertTrue(HttpUtilities.isTextContentType("text/xml")); Assert.assertTrue(HttpUtilities.isTextContentType("application/xml")); Assert.assertTrue(HttpUtilities.isTextContentType("application/x-www-form-urlencoded")); Assert.assertFalse(HttpUtilities.isTextContentType("image/gif")); Assert.assertFalse(HttpUtilities.isTextContentType(null)); }
static public boolean isTextContentType(String contentType) { return contentType != null && (Pattern.compile(IS_TEXT_REGEX_CONSTANT).matcher(contentType).find() || isFormURLEncodedContentType(contentType)); }
HttpUtilities { static public boolean isTextContentType(String contentType) { return contentType != null && (Pattern.compile(IS_TEXT_REGEX_CONSTANT).matcher(contentType).find() || isFormURLEncodedContentType(contentType)); } }
HttpUtilities { static public boolean isTextContentType(String contentType) { return contentType != null && (Pattern.compile(IS_TEXT_REGEX_CONSTANT).matcher(contentType).find() || isFormURLEncodedContentType(contentType)); } private  HttpUtilities(); }
HttpUtilities { static public boolean isTextContentType(String contentType) { return contentType != null && (Pattern.compile(IS_TEXT_REGEX_CONSTANT).matcher(contentType).find() || isFormURLEncodedContentType(contentType)); } private  HttpUtilities(); static boolean isTextContentType(String contentType); static boolean isFormURLEncodedContentType(String contentType); static boolean isCompressedContentEncoding(String encodingName); static Map<String, String> stringToUrlParams(String paramsString, String charset); static String urlParamsToString(Map<String, String> params, String charset); }
HttpUtilities { static public boolean isTextContentType(String contentType) { return contentType != null && (Pattern.compile(IS_TEXT_REGEX_CONSTANT).matcher(contentType).find() || isFormURLEncodedContentType(contentType)); } private  HttpUtilities(); static boolean isTextContentType(String contentType); static boolean isFormURLEncodedContentType(String contentType); static boolean isCompressedContentEncoding(String encodingName); static Map<String, String> stringToUrlParams(String paramsString, String charset); static String urlParamsToString(Map<String, String> params, String charset); final static String GZIP_CONSTANT; final static String DEFLATE_CONSTANT; final static String UTF8_CONSTANT; final static String HTTP_SCHEME; final static String HTTPS_SCHEME; final static int HTTP_DEFAULT_PORT; final static int HTTPS_DEFAULT_PORT; }