expo-file-system 15.2.1 → 15.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/android/build.gradle +2 -2
- package/ios/EXFileSystem/EXFileSystem.m +17 -18
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '15.2.
|
|
6
|
+
version = '15.2.2'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
76
76
|
versionCode 30
|
|
77
|
-
versionName "15.2.
|
|
77
|
+
versionName "15.2.2"
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -179,7 +179,11 @@ EX_EXPORT_METHOD_AS(getInfoAsync,
|
|
|
179
179
|
resolver:(EXPromiseResolveBlock)resolve
|
|
180
180
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
181
181
|
{
|
|
182
|
-
NSURL *uri = [NSURL
|
|
182
|
+
NSURL *uri = [NSURL URLWithString:uriString];
|
|
183
|
+
// no scheme provided in uri, handle as a local path and add 'file://' scheme
|
|
184
|
+
if (!uri.scheme) {
|
|
185
|
+
uri = [NSURL fileURLWithPath:uriString isDirectory:false];
|
|
186
|
+
}
|
|
183
187
|
if (!([self permissionsForURI:uri] & EXFileSystemPermissionRead)) {
|
|
184
188
|
reject(@"ERR_FILESYSTEM_NO_PERMISSIONS",
|
|
185
189
|
[NSString stringWithFormat:@"File '%@' isn't readable.", uri],
|
|
@@ -204,7 +208,11 @@ EX_EXPORT_METHOD_AS(readAsStringAsync,
|
|
|
204
208
|
resolver:(EXPromiseResolveBlock)resolve
|
|
205
209
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
206
210
|
{
|
|
207
|
-
NSURL *uri = [NSURL
|
|
211
|
+
NSURL *uri = [NSURL URLWithString:uriString];
|
|
212
|
+
// no scheme provided in uri, handle as a local path and add 'file://' scheme
|
|
213
|
+
if (!uri.scheme) {
|
|
214
|
+
uri = [NSURL fileURLWithPath:uriString isDirectory:false];
|
|
215
|
+
}
|
|
208
216
|
if (!([self permissionsForURI:uri] & EXFileSystemPermissionRead)) {
|
|
209
217
|
reject(@"ERR_FILESYSTEM_NO_PERMISSIONS",
|
|
210
218
|
[NSString stringWithFormat:@"File '%@' isn't readable.", uri],
|
|
@@ -267,7 +275,7 @@ EX_EXPORT_METHOD_AS(writeAsStringAsync,
|
|
|
267
275
|
resolver:(EXPromiseResolveBlock)resolve
|
|
268
276
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
269
277
|
{
|
|
270
|
-
NSURL *uri = [NSURL
|
|
278
|
+
NSURL *uri = [NSURL URLWithString:uriString];
|
|
271
279
|
if (!([self permissionsForURI:uri] & EXFileSystemPermissionWrite)) {
|
|
272
280
|
reject(@"ERR_FILESYSTEM_NO_PERMISSIONS",
|
|
273
281
|
[NSString stringWithFormat:@"File '%@' isn't writable.", uri],
|
|
@@ -327,7 +335,7 @@ EX_EXPORT_METHOD_AS(deleteAsync,
|
|
|
327
335
|
resolver:(EXPromiseResolveBlock)resolve
|
|
328
336
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
329
337
|
{
|
|
330
|
-
NSURL *uri = [NSURL
|
|
338
|
+
NSURL *uri = [NSURL URLWithString:uriString];
|
|
331
339
|
if (!([self permissionsForURI:[uri URLByAppendingPathComponent:@".."]] & EXFileSystemPermissionWrite)) {
|
|
332
340
|
reject(@"ERR_FILESYSTEM_NO_PERMISSIONS",
|
|
333
341
|
[NSString stringWithFormat:@"Location '%@' isn't deletable.", uri],
|
|
@@ -464,7 +472,7 @@ EX_EXPORT_METHOD_AS(makeDirectoryAsync,
|
|
|
464
472
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
465
473
|
{
|
|
466
474
|
|
|
467
|
-
NSURL *uri = [NSURL
|
|
475
|
+
NSURL *uri = [NSURL URLWithString:uriString];
|
|
468
476
|
if (!([self permissionsForURI:uri] & EXFileSystemPermissionWrite)) {
|
|
469
477
|
reject(@"ERR_FILESYSTEM_NO_PERMISSIONS",
|
|
470
478
|
[NSString stringWithFormat:@"Directory '%@' could not be created because the location isn't writable.", uri],
|
|
@@ -497,7 +505,7 @@ EX_EXPORT_METHOD_AS(readDirectoryAsync,
|
|
|
497
505
|
resolver:(EXPromiseResolveBlock)resolve
|
|
498
506
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
499
507
|
{
|
|
500
|
-
NSURL *uri = [NSURL
|
|
508
|
+
NSURL *uri = [NSURL URLWithString:uriString];
|
|
501
509
|
if (!([self permissionsForURI:uri] & EXFileSystemPermissionRead)) {
|
|
502
510
|
reject(@"ERR_FILESYSTEM_NO_PERMISSIONS",
|
|
503
511
|
[NSString stringWithFormat:@"Location '%@' isn't readable.", uri],
|
|
@@ -530,7 +538,7 @@ EX_EXPORT_METHOD_AS(downloadAsync,
|
|
|
530
538
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
531
539
|
{
|
|
532
540
|
NSURL *url = [NSURL URLWithString:urlString];
|
|
533
|
-
NSURL *localUri = [NSURL
|
|
541
|
+
NSURL *localUri = [NSURL URLWithString:localUriString];
|
|
534
542
|
if (!([self checkIfFileDirExists:localUri.path])) {
|
|
535
543
|
reject(@"ERR_FILESYSTEM_WRONG_DESTINATION",
|
|
536
544
|
[NSString stringWithFormat:@"Directory for '%@' doesn't exist. Please make sure directory '%@' exists before calling downloadAsync.", localUriString, [localUri.path stringByDeletingLastPathComponent]],
|
|
@@ -627,7 +635,7 @@ EX_EXPORT_METHOD_AS(uploadTaskStartAsync,
|
|
|
627
635
|
options:(NSDictionary *)options
|
|
628
636
|
rejecter:(EXPromiseRejectBlock)reject
|
|
629
637
|
{
|
|
630
|
-
NSURL *fileUri = [NSURL
|
|
638
|
+
NSURL *fileUri = [NSURL URLWithString:fileUriString];
|
|
631
639
|
NSString *httpMethod = options[@"httpMethod"];
|
|
632
640
|
EXFileSystemUploadType type = [self _getUploadTypeFrom:options[@"uploadType"]];
|
|
633
641
|
if (![fileUri.scheme isEqualToString:@"file"]) {
|
|
@@ -694,7 +702,7 @@ EX_EXPORT_METHOD_AS(downloadResumableStartAsync,
|
|
|
694
702
|
rejecter:(EXPromiseRejectBlock)reject)
|
|
695
703
|
{
|
|
696
704
|
NSURL *url = [NSURL URLWithString:urlString];
|
|
697
|
-
NSURL *localUrl = [NSURL
|
|
705
|
+
NSURL *localUrl = [NSURL URLWithString:fileUri];
|
|
698
706
|
if (!([self checkIfFileDirExists:localUrl.path])) {
|
|
699
707
|
reject(@"ERR_FILESYSTEM_WRONG_DESTINATION",
|
|
700
708
|
[NSString stringWithFormat:@"Directory for '%@' doesn't exist. Please make sure directory '%@' exists before calling downloadAsync.", fileUri, [localUrl.path stringByDeletingLastPathComponent]],
|
|
@@ -1004,15 +1012,6 @@ EX_EXPORT_METHOD_AS(getTotalDiskCapacityAsync, getTotalDiskCapacityAsyncWithReso
|
|
|
1004
1012
|
return [self _checkIfFileExists:dir];
|
|
1005
1013
|
}
|
|
1006
1014
|
|
|
1007
|
-
- (NSString *)removeFileSchemefromURIString:(NSString *)path
|
|
1008
|
-
{
|
|
1009
|
-
if ([path hasPrefix:@"file:///"]) {
|
|
1010
|
-
return [path substringFromIndex:7];
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
return [path copy];
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
1015
|
#pragma mark - Class methods
|
|
1017
1016
|
|
|
1018
1017
|
- (BOOL)ensureDirExistsWithPath:(NSString *)path
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-file-system",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.2",
|
|
4
4
|
"description": "Provides access to the local file system on the device.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"expo": "*"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b019b92ea02e108eece600aae9fb104a3611bdeb"
|
|
48
48
|
}
|