File tree Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 11## CHANGE LOG
22
3+ ### v6.0.5
4+ 2014-07-20 issue [ #61 ] ( https://github.com/qiniu/android-sdk/pull/61 )
5+
6+ - [ #60 ] bug 成功返回时body 如果是null 会出错
7+
38### v6.0.4
492014-07-20 issue [ #58 ] ( https://github.com/qiniu/android-sdk/pull/58 )
510
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public JSONObjectRet(){}
1313 public void onSuccess (byte [] body ) {
1414 if (body == null ) {
1515 onSuccess (new JSONObject ());
16+ return ;
1617 }
1718 try {
1819 JSONObject obj = new JSONObject (new String (body ));
Original file line number Diff line number Diff line change 11package com .qiniu .conf ;
22
3+ import java .util .Random ;
4+
35public class Conf {
4- public static final String VERSION = "6.0.4 " ;
6+ public static final String VERSION = "6.0.5 " ;
57 public static String UP_HOST = "http://upload.qiniu.com" ;
68 public static String UP_HOST2 = "http://up.qiniu.com" ;
79
10+ private static String id = genId ();
11+
812 public static String getUserAgent () {
9- return "QiniuAndroid/" + VERSION + " (" + android .os .Build .VERSION .RELEASE + "; " + android .os .Build .MODEL + ")" ;
13+ return "QiniuAndroid/" + VERSION + " (" + android .os .Build .VERSION .RELEASE + "; "
14+ + android .os .Build .MODEL + "; " + id +")" ;
15+ }
16+
17+ private static String genId (){
18+ Random r = new Random ();
19+ int rnum = r .nextInt (999 );
20+ return System .currentTimeMillis () + "" + rnum ;
1021 }
1122}
Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ private void successCheck() throws JSONException{
166166 Assert .assertTrue (success );
167167 Assert .assertNotNull (resp .optString ("hash" ));
168168 Assert .assertEquals (file .length (), resp .getLong ("fsize" ));
169+ Assert .assertEquals (key , resp .getString ("key" ));
169170 }
170171
171172 private File createFile (double fileSize , String suf ) throws IOException {
You can’t perform that action at this time.
0 commit comments