Skip to content

Commit

Permalink
Merge pull request #797 from reactrondev/master
Browse files Browse the repository at this point in the history
Add path to the Android download folder
  • Loading branch information
itinance authored Feb 20, 2020
2 parents db614b4 + 280bc06 commit 06572ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions FS.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ var RNFS = {
CachesDirectoryPath: RNFSManager.RNFSCachesDirectoryPath,
ExternalCachesDirectoryPath: RNFSManager.RNFSExternalCachesDirectoryPath,
DocumentDirectoryPath: RNFSManager.RNFSDocumentDirectoryPath,
DownloadDirectoryPath: RNFSManager.RNFSDownloadDirectoryPath,
ExternalDirectoryPath: RNFSManager.RNFSExternalDirectoryPath,
ExternalStorageDirectoryPath: RNFSManager.RNFSExternalStorageDirectoryPath,
TemporaryDirectoryPath: RNFSManager.RNFSTemporaryDirectoryPath,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ The following constants are available on the `RNFS` export:
- `CachesDirectoryPath` (`String`) The absolute path to the caches directory
- `ExternalCachesDirectoryPath` (`String`) The absolute path to the external caches directory (android only)
- `DocumentDirectoryPath` (`String`) The absolute path to the document directory
- `DownloadDirectoryPath` (`String`) The absolute path to the download directory (on android only)
- `TemporaryDirectoryPath` (`String`) The absolute path to the temporary directory (falls back to Caching-Directory on Android)
- `LibraryDirectoryPath` (`String`) The absolute path to the NSLibraryDirectory (iOS only)
- `ExternalDirectoryPath` (`String`) The absolute path to the external files, shared directory (android only)
Expand Down
2 changes: 2 additions & 0 deletions android/src/main/java/com/rnfs/RNFSManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class RNFSManager extends ReactContextBaseJavaModule {
private static final String RNFSExternalDirectoryPath = "RNFSExternalDirectoryPath";
private static final String RNFSExternalStorageDirectoryPath = "RNFSExternalStorageDirectoryPath";
private static final String RNFSPicturesDirectoryPath = "RNFSPicturesDirectoryPath";
private static final String RNFSDownloadDirectoryPath = "RNFSDownloadDirectoryPath";
private static final String RNFSTemporaryDirectoryPath = "RNFSTemporaryDirectoryPath";
private static final String RNFSCachesDirectoryPath = "RNFSCachesDirectoryPath";
private static final String RNFSExternalCachesDirectoryPath = "RNFSExternalCachesDirectoryPath";
Expand Down Expand Up @@ -979,6 +980,7 @@ public Map<String, Object> getConstants() {
constants.put(RNFSTemporaryDirectoryPath, this.getReactApplicationContext().getCacheDir().getAbsolutePath());
constants.put(RNFSPicturesDirectoryPath, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());
constants.put(RNFSCachesDirectoryPath, this.getReactApplicationContext().getCacheDir().getAbsolutePath());
constants.put(RNFSDownloadDirectoryPath, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath());
constants.put(RNFSFileTypeRegular, 0);
constants.put(RNFSFileTypeDirectory, 1);

Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export function touch(
export const MainBundlePath: string
export const CachesDirectoryPath: string
export const ExternalCachesDirectoryPath: string
export const DownloadDirectoryPath: string
export const DocumentDirectoryPath: string
export const ExternalDirectoryPath: string
export const ExternalStorageDirectoryPath: string
Expand Down

0 comments on commit 06572ce

Please sign in to comment.