public static boolean jsonContentType(String contentType) { String baseType = HttpUtils.baseContentType(contentType); return baseType != null && ("application/json".equals(baseType) || "text/json".equals(baseType)); }
public static String getCharset(String contentType, String defaultCharset) { String charset = HttpUtils.getCharset(contentType); if (charset == null) { return defaultCharset; } else { return charset; } }
private boolean textContentType(String contentType) { return HttpUtils.textContentType(contentType); }
String defCharset = HttpUtils.getCharset(contentType); contentType = HttpUtils.baseContentType(contentType);
private boolean jsonContentType(String contentType) { return runtime.transparentJSON() && HttpUtils.jsonContentType(contentType); }
private boolean xmlContentType(String contentType) { return HttpUtils.xmlContentType(contentType); }
String defCharset = HttpUtils.getCharset(contentType); contentType = HttpUtils.baseContentType(contentType);
private boolean jsonContentType(String contentType) { return runtime.transparentJSON() && HttpUtils.jsonContentType(contentType); }
private boolean xmlContentType(String contentType) { return HttpUtils.xmlContentType(contentType); }
public static String getCharset(String contentType, String defaultCharset) { String charset = HttpUtils.getCharset(contentType); if (charset == null) { return defaultCharset; } else { return charset; } }
public static boolean xmlContentType(String contentType) { String baseType = HttpUtils.baseContentType(contentType); return baseType != null && ("application/xml".equals(baseType) || "text/xml".equals(baseType) || baseType.endsWith("+xml")); }
if (runtime.transparentJSON() && HttpUtils.jsonContentType(contentType)) { if (charset == null) {
private boolean textContentType(String contentType) { return HttpUtils.textContentType(contentType); }
private String parseCharset(String contentType) { String charset = HttpUtils.getCharset(contentType); if (charset != null) { return charset.toLowerCase(); } return null; } }
public static boolean jsonContentType(String contentType) { String baseType = HttpUtils.baseContentType(contentType); return baseType != null && ("application/json".equals(baseType) || "text/json".equals(baseType)); }
if (runtime.transparentJSON() && HttpUtils.jsonContentType(contentType)) { if (charset == null) {
private String parseCharset(String contentType) { String charset = HttpUtils.getCharset(contentType); if (charset != null) { return charset.toLowerCase(); } return null; } }
public static boolean xmlContentType(String contentType) { String baseType = HttpUtils.baseContentType(contentType); return baseType != null && ("application/xml".equals(baseType) || "text/xml".equals(baseType) || baseType.endsWith("+xml")); }
public void load(URI id, String media, InputStream content, long len) throws IOException { String cs = HttpUtils.getCharset(media); if (cs == null) { cs = Charset.defaultCharset().name(); } InputStreamReader reader = new InputStreamReader(content, cs); JSONTokener jt = new JSONTokener(reader); Processor processor = runtime.getProcessor(); String flavor = runtime.jsonFlavor(); documents.add(JSONtoXML.convert(processor, jt, flavor)); } });
public void load(URI id, String media, InputStream content, long len) throws IOException { String cs = HttpUtils.getCharset(media); if (cs == null) { cs = Charset.defaultCharset().name(); } InputStreamReader reader = new InputStreamReader(content, cs); JSONTokener jt = new JSONTokener(reader); Processor processor = runtime.getProcessor(); String flavor = runtime.jsonFlavor(); documents.add(JSONtoXML.convert(processor, jt, flavor)); } });