Sin descripción

RNFetchBlobConfig.java 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.RNFetchBlob;
  2. import com.facebook.react.bridge.ReadableMap;
  3. import java.util.HashMap;
  4. /**
  5. * Created by wkh237 on 2016/5/29.
  6. */
  7. public class RNFetchBlobConfig {
  8. public Boolean fileCache;
  9. public String path;
  10. public String appendExt;
  11. public ReadableMap addAndroidDownloads;
  12. public Boolean trusty;
  13. public String key;
  14. public String mime;
  15. public Boolean auto;
  16. public long timeout = -1;
  17. RNFetchBlobConfig(ReadableMap options) {
  18. if(options == null)
  19. return;
  20. this.fileCache = options.hasKey("fileCache") ? options.getBoolean("fileCache") : false;
  21. this.path = options.hasKey("path") ? options.getString("path") : null;
  22. this.appendExt = options.hasKey("appendExt") ? options.getString("appendExt") : "";
  23. this.trusty = options.hasKey("trusty") ? options.getBoolean("trusty") : false;
  24. if(options.hasKey("addAndroidDownloads")) {
  25. this.addAndroidDownloads = options.getMap("addAndroidDownloads");
  26. }
  27. this.key = options.hasKey("key") ? options.getString("key") : null;
  28. this.mime = options.hasKey("contentType") ? options.getString("contentType") : null;
  29. this.auto = options.hasKey("auto") ? options.getBoolean("auto") : false;
  30. if(options.hasKey("timeout")) {
  31. this.timeout = options.getInt("timeout");
  32. }
  33. }
  34. }