There are a million issues around people having issues with automatically linking and having a link to manual instructions would address a lot of these up front. This also follows the instructions pattern of most react native modules.
* fs.js: forgot one more error refactoring
* Fix path argument in iOS excludeFromBackupKey (#473)
* Fix link to fs.readStream() and to fs.writeStream() and insert link to new function fs.hash()
* Fix the documentation part of https://github.com/wkh237/react-native-fetch-blob/issues/467 "Example code for writeStream ignores that stream.write() returns a promise?"
* More fixes for issue https://github.com/wkh237/react-native-fetch-blob/issues/460 "Error normalization"
IMPORTANT: I wrote the iOS code BLIND (not even syntax highlighting) - this needs to be tested.
- Two or three methods that used callbacks to return results were changed to RN promises
- All methods using promises now use a Unix like code string for the first parameter, e.g. "ENOENT" for "File does not exist" (http://www.alorelang.org/doc/errno.html). The React Native bridge code itself uses this schema: it inserts "EUNSPECIFIED" when the "code" it gets back from Android/iOS code is undefined (null, nil). The RN bridge assigns the code (or "EUNSPECIFIED") to the "code" property of the error object it returns to Javascript, following the node.js example (the "code" property is not part of "standard" Javascript Error objects)
- Important errors like "No such file" are reported (instead of a general error), using the code property.
- I added a few extra error checks that the IDE suggested, mostly for Android (for which I have an IDE), if it seemed important I tried to do the same for teh iOS equivalent function
- I followed IDE suggestions on some of the Java code, like making fields private
- RNFetchBlobFS.java removeSession(): Added reporting of all failures to delete - IS THIS DESIRABLE (or do we not care)?
- readStream: The same schema is used for the emitted events when they are error events
- iOS: added an import for the crypto-digest headers - they are needed for the hash() function submitted in an earlier commit
- Fixed a link in the README.md - unfortunately the anchor-links change whenever even one character of the linked headline in the Wiki page changes
* Fix one issue raised in https://github.com/wkh237/react-native-fetch-blob/issues/477 by using code from https://stackoverflow.com/a/40874952/544779
* fix some access rights, remove unused items
* update gradle version setting in build.gradle
* Revert gradle settings to previous values :-(
* add a missing closing ")"
* Removed the part of an obsolete callback function parameter that I had left in when I converted mkdir to promises (low-level code)
* let mkdir resolve with "undefined" instead of "null" (my mistake)
* mkdir: normalize iOS and Android error if something already exists (file OR folder); return "true" (boolean) on success (failure is rejected promise) - it is not possibel to return "undefined" from a React Native promise from Java
* fix a long/int issue
* my mistake - according to https://facebook.github.io/react-native/docs/native-modules-android.html#argument-types "long" is not possible as argument type of an exported RN native module function
* Adde "utf8" as default encoding for fs.readFile - fixes #450 and #484
* follow my IDEA IDE's recommendations - SparseArray instead of HashMap, and make some fields private
* polyfill/File.js: add a parameter===undefined? check (this happened silently in the test suite)
* make var static again
* Normalized errors for fs.ls()
* forgot one parameter
* more parameter checks
* forgot to resolve the promise
* Forgot ;
* add more error parameter checks
* change readStream()/writeStream() default encoding to utf8 to match the tests in react-native-fetch-blob-dev
* default encoding is set in fs.js (now), no need to do it twice
* ReadStream error events: Set a default error code "EUNSPECIFIED" if no code is returned (should not happen, actually)
* writeFile() Android and iOS: improve errors; ReadStream: Add "ENOENT" (no such file) error event to Android version and add the thus far missing "code" parameter to iOS version
* oops - one "}" too many - removed
* add EISDIR error to readFile()s error vocabulary (iOS and Android)
* "or directory" is misplaced in a "no such file" error message for readFile()
* Android: two reject() calls did not have a code, iOS: slice() did not have code EISDIR, and "could not resolve URI" now is EINVAL everywhere
* writeStream: return ENOENT, EISDIR and EUNSPECIFIED according to the normalized schema (#460); Open a new question about behavior on ENOENT (#491)
* "+ +" was one plus sign too many
* this if has a whole block (that ois why I prefer a style where {} are mandatory even for single-statement blocks)
* I renamed this variable
* 1) #491 "writeStream() does not create file if it doesn't exist?"
2) I had gone overboard with the "@[..]" in the ios code, making some error strings arrays
3) fix typos: rename all ENODIR => ENOTDIR
* Java: getParentFolder() may return null - prevent a NullPointerException by adding one more check
* Relating to #298 -- looping through an array is not supposed to be done with for...in
* Fix IOS syntax errors in #489
* #489 Fix typo and missing return statement
* fix error code