static BaasResult<BaasStream> doStreamSync(String id, String spec, int sizeId) { BaasBox box = BaasBox.getDefaultChecked(); if (id == null) throw new IllegalArgumentException("id cannot be null"); StreamRequest synReq = new StreamRequest(box, "asset", id, spec, sizeId); return box.submitSync(synReq); }
/** * Synchronously retrieves named assets data, If the named asset is a document, the document is * retrieved otherwise attached data to the file are returned. * * @param id the name of the asset * @return a baas result wrapping the response. */ public static BaasResult<JsonObject> fetchDataSync(String id) { if (id == null) throw new IllegalArgumentException("asset id cannot be null"); BaasBox box = BaasBox.getDefaultChecked(); AssetDataRequest req = new AssetDataRequest(box, id, RequestOptions.DEFAULT, null); return box.submitSync(req); }