2020
2121public class IoApi {
2222
23- public static final String UNDEFINED_KEY = "?" ;
23+ public static final String UNDEFINED_KEY = null ;
2424 public static final int NO_CRC32 = 0 ;
2525 public static final int AUTO_CRC32 = 1 ;
2626 public static final int WITH_CRC32 = 2 ;
@@ -54,7 +54,7 @@ private static PutRet put(String uptoken, String key, File file,
5454 return new PutRet (ret );
5555 }
5656
57- private static AbstractContentBody buildFileBody (File file ,PutExtra extra ){
57+ private static FileBody buildFileBody (File file ,PutExtra extra ){
5858 if (extra .mimeType != null ){
5959 return new FileBody (file , extra .mimeType );
6060 }else {
@@ -63,7 +63,7 @@ private static AbstractContentBody buildFileBody(File file,PutExtra extra){
6363 }
6464
6565 private static void setKey (MultipartEntity requestEntity , String key ) throws UnsupportedEncodingException {
66- if (key != null && key . trim (). length () > 0 ){
66+ if (key != null ){
6767 requestEntity .addPart ("key" , new StringBody (key ,Charset .forName ("utf-8" )));
6868 }
6969 }
@@ -91,7 +91,7 @@ private static PutRet putStream(String uptoken, String key, InputStream reader,P
9191 return new PutRet (ret );
9292 }
9393
94- private static AbstractContentBody buildInputStreamBody (InputStream reader ,PutExtra extra , String key ){
94+ private static InputStreamBody buildInputStreamBody (InputStream reader ,PutExtra extra , String key ){
9595 if (extra .mimeType != null ){
9696 return new InputStreamBody (reader , extra .mimeType , key );
9797 }else {
0 commit comments