执行mkzip 可以正常返回persistentId,但是无法在空间里找到压缩后的zip文件
private static final Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY); private static final String bucketname = "xxx"; public static void mkzipTest() { OperationManager om = new OperationManager(auth); String u = "http://7xsqur.com2.z0.glb.clouddn.com/gogopher.jpg"; String saveas = "abc.zip"; String fops = "mkzip/2/url/" +UrlSafeBase64.encodeToString(u)+ "|saveas/"+UrlSafeBase64.encodeToString(saveas); System.out.println(fops); try { String pfop = om.pfop(bucketname, "test.zip", fops); System.out.println(pfop); } catch (QiniuException e) { Response r = e.response; // 请求失败时打印的异常的信息 // System.out.println(r.toString()); try { // 响应的文本信息 System.out.println(r.bodyString()); } catch (QiniuException e1) { // ignore } } }
http://api.qiniu.com/status/get/prefop?id=
你通过这个链接拼接上你上面返回的z0.571xxxx这个persistentId来查看是否成功,没有成功的话,你可以在上面看到报错