public Content withAssets(String... assets) throws NullPointerException { if (assets == null) { throw new NullPointerException("No null asset accepted"); } for (String asset : assets) { with(PropertyType.ASSET, asset); } return this; }
public Content withAssets(String... assets) throws NullPointerException { if (assets == null) { throw new NullPointerException("No null asset accepted"); } for (String asset : assets) { with(PropertyType.ASSET, asset); } return this; }
public Content withMetaTag(String name, String value) { with(PropertyType.META_TAG, new AbstractMap.SimpleEntry<String, String>(name, value)); return this; }
return Response.ok(result.toString()).with(PropertyType.MIME_TYPE, "application/json"); } else { if (file != null && file.getContentType().contains("png")) {
return Response.ok(result.toString()).with(PropertyType.MIME_TYPE, "application/json");
/** * return the object data contains the url of logo and the bar navigation * * @param httpContext * @return Resource */ @Ajax @Resource public Response.Content getResource(HttpContext httpContext) { JSONObject json = new JSONObject(); String style = "Dark"; if (settingService.get(Context.GLOBAL, Scope.GLOBAL, BAR_NAVIGATION_STYLE_KEY) != null) { style = (String) settingService.get(Context.GLOBAL, Scope.GLOBAL, BAR_NAVIGATION_STYLE_KEY) .getValue(); } try { json.put("error", "0"); json.put("style", style); json.put("logoUrl", getLogoUrl(httpContext, true)); } catch (JSONException ex) { if (LOG.isErrorEnabled()) { LOG.error("Can not put json value", ex); } } return Response.ok(json.toString()).with(PropertyType.MIME_TYPE, "application/json"); }
public Content withTitle(String title) { return with(PropertyType.TITLE, title); }
public Content withTitle(String title) { return with(PropertyType.TITLE, title); }
public Content withMetaHttpEquiv(String name, String value) { with(PropertyType.META_HTTP_EQUIV, new AbstractMap.SimpleEntry<String, String>(name, value)); return this; }
public Content withMetaHttpEquiv(String name, String value) { with(PropertyType.META_HTTP_EQUIV, new AbstractMap.SimpleEntry<String, String>(name, value)); return this; }
public Content withMetaTag(String name, String value) { with(PropertyType.META_TAG, new AbstractMap.SimpleEntry<String, String>(name, value)); return this; }
/** * Set the provided element on the response as an HTML header. * * @param header the header * @return this object */ public Content withHeaderTag(Element header) { return with(PropertyType.HEADER_TAG, header); }
/** * Set the provided element on the response as an HTML header. * * @param header the header * @return this object */ public Content withHeaderTag(Element header) { return with(PropertyType.HEADER_TAG, header); }