mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-03-01 07:20:33 +00:00
Fixes
This commit is contained in:
parent
7bf7c0bca1
commit
bdeda5ef36
@ -196,7 +196,7 @@ var RNFS = {
|
|||||||
CachesDirectoryPath: RNFSManager.NSCachesDirectoryPath,
|
CachesDirectoryPath: RNFSManager.NSCachesDirectoryPath,
|
||||||
DocumentDirectoryPath: RNFSManager.NSDocumentDirectoryPath,
|
DocumentDirectoryPath: RNFSManager.NSDocumentDirectoryPath,
|
||||||
ExternalDirectoryPath: RNFSManager.NSExternalDirectoryPath,
|
ExternalDirectoryPath: RNFSManager.NSExternalDirectoryPath,
|
||||||
TemporaryDirectoryPathIOS: RNFSManager.NSTemporaryDirectoryPath,
|
TemporaryDirectoryPath: RNFSManager.NSTemporaryDirectoryPath,
|
||||||
LibraryDirectoryPath: RNFSManager.NSLibraryDirectoryPath,
|
LibraryDirectoryPath: RNFSManager.NSLibraryDirectoryPath,
|
||||||
PicturesDirectoryPath: RNFSManager.NSPicturesDirectoryPath
|
PicturesDirectoryPath: RNFSManager.NSPicturesDirectoryPath
|
||||||
};
|
};
|
||||||
|
@ -186,6 +186,7 @@ The following constants are available on the `RNFS` export:
|
|||||||
`MainBundlePath` (`String`) The absolute path to the main bundle directory
|
`MainBundlePath` (`String`) The absolute path to the main bundle directory
|
||||||
`CachesDirectoryPath` (`String`) The absolute path to the caches directory
|
`CachesDirectoryPath` (`String`) The absolute path to the caches directory
|
||||||
`DocumentDirectoryPath` (`String`) The absolute path to the document directory
|
`DocumentDirectoryPath` (`String`) The absolute path to the document directory
|
||||||
|
`TemporaryDirectoryPath` (`String`) The absolute path to the temporary directory (iOS only)
|
||||||
`ExternalDirectoryPath` (`String`) The absolute path to the external, shared directory (android only)
|
`ExternalDirectoryPath` (`String`) The absolute path to the external, shared directory (android only)
|
||||||
|
|
||||||
### `promise readDir(path)`
|
### `promise readDir(path)`
|
||||||
|
@ -41,6 +41,7 @@ public class RNFSManager extends ReactContextBaseJavaModule {
|
|||||||
private static final String NSDocumentDirectoryPath = "NSDocumentDirectoryPath";
|
private static final String NSDocumentDirectoryPath = "NSDocumentDirectoryPath";
|
||||||
private static final String NSExternalDirectoryPath = "NSExternalDirectoryPath";
|
private static final String NSExternalDirectoryPath = "NSExternalDirectoryPath";
|
||||||
private static final String NSPicturesDirectoryPath = "NSPicturesDirectoryPath";
|
private static final String NSPicturesDirectoryPath = "NSPicturesDirectoryPath";
|
||||||
|
private static final String NSTemporaryDirectoryPath = "NSTemporaryDirectoryPath";
|
||||||
private static final String NSCachesDirectoryPath = "NSCachesDirectoryPath";
|
private static final String NSCachesDirectoryPath = "NSCachesDirectoryPath";
|
||||||
private static final String NSDocumentDirectory = "NSDocumentDirectory";
|
private static final String NSDocumentDirectory = "NSDocumentDirectory";
|
||||||
|
|
||||||
@ -332,6 +333,7 @@ public class RNFSManager extends ReactContextBaseJavaModule {
|
|||||||
final Map<String, Object> constants = new HashMap<>();
|
final Map<String, Object> constants = new HashMap<>();
|
||||||
constants.put(NSDocumentDirectory, 0);
|
constants.put(NSDocumentDirectory, 0);
|
||||||
constants.put(NSDocumentDirectoryPath, this.getReactApplicationContext().getFilesDir().getAbsolutePath());
|
constants.put(NSDocumentDirectoryPath, this.getReactApplicationContext().getFilesDir().getAbsolutePath());
|
||||||
|
constants.put(NSTemporaryDirectoryPath, null)
|
||||||
File externalDirectory = this.getReactApplicationContext().getExternalFilesDir(null);
|
File externalDirectory = this.getReactApplicationContext().getExternalFilesDir(null);
|
||||||
if (externalDirectory != null) {
|
if (externalDirectory != null) {
|
||||||
constants.put(NSExternalDirectoryPath, externalDirectory.getAbsolutePath());
|
constants.put(NSExternalDirectoryPath, externalDirectory.getAbsolutePath());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user