Browse Source

Fix appendExt

Ben Hsieh 8 years ago
parent
commit
6f46cd431d
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 3
- 2
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java View File

@@ -167,7 +167,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
167 167
 
168 168
         // find cached result if `key` property exists
169 169
         String cacheKey = this.taskId;
170
-        String ext = this.options.appendExt.isEmpty() ? "." + this.options.appendExt : "";
170
+        String ext = this.options.appendExt.isEmpty() ? "" : "." + this.options.appendExt;
171 171
 
172 172
         if (this.options.key != null) {
173 173
             cacheKey = RNFetchBlobUtils.getMD5(this.options.key);
@@ -188,6 +188,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
188 188
         else if(this.options.fileCache)
189 189
             this.destPath = RNFetchBlobFS.getTmpPath(RNFetchBlob.RCTContext, cacheKey) + ext;
190 190
 
191
+
191 192
         OkHttpClient.Builder clientBuilder;
192 193
 
193 194
         try {
@@ -497,7 +498,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
497 498
                     // and write response data to destination path.
498 499
                     resp.body().bytes();
499 500
                 } catch (Exception ignored) {
500
-                    ignored.printStackTrace();
501
+//                    ignored.printStackTrace();
501 502
                 }
502 503
                 this.destPath = this.destPath.replace("?append=true", "");
503 504
                 callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);