@@ -30,7 +30,7 @@ private static PutRet put(String uptoken, String key, File file,
3030 PutExtra extra ) {
3131
3232 if (!file .exists () || !file .canRead ()) {
33- return new PutRet (new CallRet (400 , new Exception (
33+ return new PutRet (new CallRet (Config . ERROR_CODE , new Exception (
3434 "File does not exist or not readable." )));
3535 }
3636 MultipartEntity requestEntity = new MultipartEntity ();
@@ -42,7 +42,7 @@ private static PutRet put(String uptoken, String key, File file,
4242 setParam (requestEntity , extra .params );
4343 if (extra .checkCrc != NO_CRC32 ) {
4444 if (extra .crc32 == 0 ) {
45- return new PutRet (new CallRet (400 , new Exception ("no crc32 specified!" )));
45+ return new PutRet (new CallRet (Config . ERROR_CODE , new Exception ("no crc32 specified!" )));
4646 }
4747 requestEntity .addPart ("crc32" , new StringBody (extra .crc32 + "" ));
4848 }
@@ -54,7 +54,7 @@ private static PutRet put(String uptoken, String key, File file,
5454 }
5555 } catch (Exception e ) {
5656 e .printStackTrace ();
57- return new PutRet (new CallRet (400 , e ));
57+ return new PutRet (new CallRet (Config . ERROR_CODE , e ));
5858 }
5959
6060 String url = Config .UP_HOST ;
@@ -95,13 +95,13 @@ private static PutRet putStream(String uptoken, String key, InputStream reader,P
9595 setParam (requestEntity , extra .params );
9696 if (extra .checkCrc != NO_CRC32 ) {
9797 if (extra .crc32 == 0 ) {
98- return new PutRet (new CallRet (400 , new Exception ("no crc32 specified!" )));
98+ return new PutRet (new CallRet (Config . ERROR_CODE , new Exception ("no crc32 specified!" )));
9999 }
100100 requestEntity .addPart ("crc32" , new StringBody (extra .crc32 + "" ));
101101 }
102102 } catch (Exception e ) {
103103 e .printStackTrace ();
104- return new PutRet (new CallRet (400 , e ));
104+ return new PutRet (new CallRet (Config . ERROR_CODE , e ));
105105 }
106106
107107 String url = Config .UP_HOST ;
@@ -138,7 +138,7 @@ public static PutRet putFile(String uptoken, String key, String fileName, PutExt
138138 try {
139139 extra .crc32 = getCRC32 (file );
140140 } catch (Exception e ) {
141- return new PutRet (new CallRet (400 , e ));
141+ return new PutRet (new CallRet (Config . ERROR_CODE , e ));
142142 }
143143 }
144144 return put (uptoken , key , file , extra );
0 commit comments