expo-file-system 19.0.18 → 19.0.19
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 +10 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/filesystem/FileSystemExceptions.kt +5 -0
- package/android/src/main/java/expo/modules/filesystem/FileSystemFile.kt +6 -0
- package/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt +4 -0
- package/android/src/main/java/expo/modules/filesystem/unifiedfile/AssetFile.kt +17 -0
- package/android/src/main/java/expo/modules/filesystem/unifiedfile/JavaFile.kt +10 -0
- package/android/src/main/java/expo/modules/filesystem/unifiedfile/SAFDocumentFile.kt +5 -0
- package/android/src/main/java/expo/modules/filesystem/unifiedfile/UnifiedFileInterface.kt +2 -0
- package/build/ExpoFileSystem.types.d.ts +18 -5
- package/build/ExpoFileSystem.types.d.ts.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/FileSystemModule.swift +12 -0
- package/ios/FileSystemPath.swift +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/{19.0.18/expo.modules.filesystem-19.0.18-sources.jar → 19.0.19/expo.modules.filesystem-19.0.19-sources.jar} +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/{19.0.18/expo.modules.filesystem-19.0.18.module → 19.0.19/expo.modules.filesystem-19.0.19.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/{19.0.18/expo.modules.filesystem-19.0.18.pom → 19.0.19/expo.modules.filesystem-19.0.19.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.19/expo.modules.filesystem-19.0.19.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/src/ExpoFileSystem.types.ts +18 -5
- package/src/index.ts +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 19.0.19 — 2025-11-18
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- [Android] Add contentUri property. ([#40002](https://github.com/expo/expo/pull/40002) by [@aleqsio](https://github.com/aleqsio))
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- [iOS] Add missing `createFile` and `createDirectory` methods. ([#40314](https://github.com/expo/expo/pull/40314) by [@jakex7](https://github.com/jakex7))
|
|
22
|
+
|
|
13
23
|
## 19.0.18 — 2025-11-17
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -44,6 +44,11 @@ internal class UnableToWriteHandleException(reason: String) :
|
|
|
44
44
|
"Unable to write to a file handle: '$reason'"
|
|
45
45
|
)
|
|
46
46
|
|
|
47
|
+
internal class MissingAppContextException :
|
|
48
|
+
CodedException(
|
|
49
|
+
"The app context is missing."
|
|
50
|
+
)
|
|
51
|
+
|
|
47
52
|
internal class PickerCancelledException :
|
|
48
53
|
CodedException("The file picker was cancelled by the user")
|
|
49
54
|
|
|
@@ -126,6 +126,12 @@ class FileSystemFile(uri: Uri) : FileSystemPath(uri) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
fun asContentUri(): Uri {
|
|
130
|
+
validateType()
|
|
131
|
+
validatePermission(Permission.READ)
|
|
132
|
+
return file.getContentUri(appContext ?: throw MissingAppContextException())
|
|
133
|
+
}
|
|
134
|
+
|
|
129
135
|
@OptIn(ExperimentalStdlibApi::class)
|
|
130
136
|
val md5: String get() {
|
|
131
137
|
validatePermission(Permission.READ)
|
|
@@ -4,7 +4,9 @@ import android.content.Context
|
|
|
4
4
|
import android.net.Uri
|
|
5
5
|
import android.webkit.MimeTypeMap
|
|
6
6
|
import androidx.core.net.toUri
|
|
7
|
+
import expo.modules.kotlin.AppContext
|
|
7
8
|
import java.io.File
|
|
9
|
+
import java.io.FileOutputStream
|
|
8
10
|
import java.io.InputStream
|
|
9
11
|
import java.io.OutputStream
|
|
10
12
|
|
|
@@ -25,6 +27,21 @@ class AssetFile(private val context: Context, override val uri: Uri) : UnifiedFi
|
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
// Cache the content URI to avoid redundant file writes – assets are read-only
|
|
31
|
+
var contentUri: Uri? = null
|
|
32
|
+
override fun getContentUri(appContext: AppContext): Uri {
|
|
33
|
+
inputStream().use { inputStream ->
|
|
34
|
+
val outputFile = File(context.cacheDir, "expo_shared_assets/$fileName")
|
|
35
|
+
outputFile.parentFile?.mkdirs() // Create directories if needed
|
|
36
|
+
FileOutputStream(outputFile).use { outputStream ->
|
|
37
|
+
inputStream.copyTo(outputStream)
|
|
38
|
+
}
|
|
39
|
+
val newContentUri = JavaFile(outputFile.toUri()).getContentUri(appContext)
|
|
40
|
+
contentUri = newContentUri
|
|
41
|
+
return newContentUri
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
28
45
|
override val parentFile: UnifiedFileInterface?
|
|
29
46
|
get() {
|
|
30
47
|
val currentPath = uri.path.orEmpty()
|
|
@@ -3,7 +3,9 @@ package expo.modules.filesystem.unifiedfile
|
|
|
3
3
|
import android.net.Uri
|
|
4
4
|
import android.os.Build
|
|
5
5
|
import android.webkit.MimeTypeMap
|
|
6
|
+
import androidx.core.content.FileProvider
|
|
6
7
|
import androidx.core.net.toUri
|
|
8
|
+
import expo.modules.kotlin.AppContext
|
|
7
9
|
import java.io.File
|
|
8
10
|
import java.io.FileInputStream
|
|
9
11
|
import java.io.FileOutputStream
|
|
@@ -38,6 +40,14 @@ class JavaFile(override val uri: Uri) : UnifiedFileInterface, File(URI.create(ur
|
|
|
38
40
|
return super<File>.delete()
|
|
39
41
|
}
|
|
40
42
|
|
|
43
|
+
override fun getContentUri(appContext: AppContext): Uri {
|
|
44
|
+
return FileProvider.getUriForFile(
|
|
45
|
+
appContext.throwingActivity.application,
|
|
46
|
+
"${appContext.throwingActivity.application.packageName}.FileSystemFileProvider",
|
|
47
|
+
this
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
41
51
|
override fun listFilesAsUnified(): List<UnifiedFileInterface> =
|
|
42
52
|
super<File>.listFiles()?.map { JavaFile(it.toUri()) } ?: emptyList()
|
|
43
53
|
|
|
@@ -3,6 +3,7 @@ package expo.modules.filesystem.unifiedfile
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.net.Uri
|
|
5
5
|
import androidx.documentfile.provider.DocumentFile
|
|
6
|
+
import expo.modules.kotlin.AppContext
|
|
6
7
|
import java.io.InputStream
|
|
7
8
|
import java.io.OutputStream
|
|
8
9
|
|
|
@@ -60,6 +61,10 @@ class SAFDocumentFile(private val context: Context, override val uri: Uri) : Uni
|
|
|
60
61
|
override val fileName: String?
|
|
61
62
|
get() = documentFile?.name
|
|
62
63
|
|
|
64
|
+
override fun getContentUri(appContext: AppContext): Uri {
|
|
65
|
+
return uri
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
override val creationTime: Long? get() {
|
|
64
69
|
// It seems there's no way to get this
|
|
65
70
|
return null
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package expo.modules.filesystem.unifiedfile
|
|
2
2
|
|
|
3
3
|
import android.net.Uri
|
|
4
|
+
import expo.modules.kotlin.AppContext
|
|
4
5
|
|
|
5
6
|
interface UnifiedFileInterface {
|
|
6
7
|
fun exists(): Boolean
|
|
@@ -17,6 +18,7 @@ interface UnifiedFileInterface {
|
|
|
17
18
|
fun lastModified(): Long?
|
|
18
19
|
val creationTime: Long?
|
|
19
20
|
val fileName: String?
|
|
21
|
+
fun getContentUri(appContext: AppContext): Uri
|
|
20
22
|
fun outputStream(): java.io.OutputStream
|
|
21
23
|
fun inputStream(): java.io.InputStream
|
|
22
24
|
fun length(): Long
|
|
@@ -184,7 +184,7 @@ export declare class File {
|
|
|
184
184
|
* Retrieves content of the file as base64.
|
|
185
185
|
* @returns A promise that resolves with the contents of the file as a base64 string.
|
|
186
186
|
*/
|
|
187
|
-
base64(): string
|
|
187
|
+
base64(): Promise<string>;
|
|
188
188
|
/**
|
|
189
189
|
* Retrieves content of the file as base64.
|
|
190
190
|
* @returns The contents of the file as a base64 string.
|
|
@@ -192,12 +192,12 @@ export declare class File {
|
|
|
192
192
|
base64Sync(): string;
|
|
193
193
|
/**
|
|
194
194
|
* Retrieves byte content of the entire file.
|
|
195
|
-
* @returns A promise that resolves with the contents of the file as a Uint8Array
|
|
195
|
+
* @returns A promise that resolves with the contents of the file as a `Uint8Array`.
|
|
196
196
|
*/
|
|
197
197
|
bytes(): Promise<Uint8Array<ArrayBuffer>>;
|
|
198
198
|
/**
|
|
199
199
|
* Retrieves byte content of the entire file.
|
|
200
|
-
* @returns
|
|
200
|
+
* @returns The contents of the file as a `Uint8Array`.
|
|
201
201
|
*/
|
|
202
202
|
bytesSync(): Uint8Array;
|
|
203
203
|
/**
|
|
@@ -248,10 +248,18 @@ export declare class File {
|
|
|
248
248
|
/**
|
|
249
249
|
* A static method that downloads a file from the network.
|
|
250
250
|
*
|
|
251
|
+
* On Android, the response body streams directly into the target file. If the download fails after
|
|
252
|
+
* it starts, a partially written file may remain at the destination. On iOS, the download first
|
|
253
|
+
* completes in a temporary location and the file is moved into place only after success, so no
|
|
254
|
+
* file is left behind when the request fails.
|
|
255
|
+
*
|
|
251
256
|
* @param url - The URL of the file to download.
|
|
252
257
|
* @param destination - The destination directory or file. If a directory is provided, the resulting filename will be determined based on the response headers.
|
|
258
|
+
* @param options - Download options. When the destination already contains a file, the promise rejects with a `DestinationAlreadyExists` error unless `options.idempotent` is set to `true`. With `idempotent: true`, the download overwrites the existing file instead of failing.
|
|
253
259
|
*
|
|
254
|
-
* @returns A promise that resolves to the downloaded file.
|
|
260
|
+
* @returns A promise that resolves to the downloaded file. When the server responds with
|
|
261
|
+
* a non-2xx HTTP status, the promise rejects with an `UnableToDownload` error whose
|
|
262
|
+
* message includes the status code. No file is created in that scenario.
|
|
255
263
|
*
|
|
256
264
|
* @example
|
|
257
265
|
* ```ts
|
|
@@ -266,7 +274,7 @@ export declare class File {
|
|
|
266
274
|
*
|
|
267
275
|
* @param initialUri An optional URI pointing to an initial folder on which the file picker is opened.
|
|
268
276
|
* @param mimeType A mime type that is used to filter out files that can be picked out.
|
|
269
|
-
* @returns
|
|
277
|
+
* @returns A `File` instance or an array of `File` instances.
|
|
270
278
|
*/
|
|
271
279
|
static pickFileAsync(initialUri?: string, mimeType?: string): Promise<File | File[]>;
|
|
272
280
|
/**
|
|
@@ -289,6 +297,11 @@ export declare class File {
|
|
|
289
297
|
* A mime type of the file. An empty string if the file does not exist, or it cannot be read.
|
|
290
298
|
*/
|
|
291
299
|
type: string;
|
|
300
|
+
/**
|
|
301
|
+
* A content URI to the file that can be shared to external applications.
|
|
302
|
+
* @platform android
|
|
303
|
+
*/
|
|
304
|
+
contentUri: string;
|
|
292
305
|
}
|
|
293
306
|
export declare class FileHandle {
|
|
294
307
|
close(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoFileSystem.types.d.ts","sourceRo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I,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './FileSystem';
|
|
2
|
-
export { type FileCreateOptions, type DirectoryCreateOptions, type FileHandle, type FileInfo, type InfoOptions, type PathInfo, type DirectoryInfo, } from './ExpoFileSystem.types';
|
|
2
|
+
export { type FileCreateOptions, type DirectoryCreateOptions, type FileHandle, type FileInfo, type InfoOptions, type PathInfo, type DirectoryInfo, type DownloadOptions, } from './ExpoFileSystem.types';
|
|
3
3
|
export * from './legacyWarnings';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
|
package/expo-module.config.json
CHANGED
|
@@ -335,6 +335,18 @@ public final class FileSystemModule: Module {
|
|
|
335
335
|
try directory.listAsRecords()
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
+
Function("createFile") { (directory, name: String, content: String?) in
|
|
339
|
+
let file = FileSystemFile(url: directory.url.appendingPathComponent(name))
|
|
340
|
+
try file.create(CreateOptions())
|
|
341
|
+
return file
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
Function("createDirectory") { (directory, name: String) in
|
|
345
|
+
let newDirectory = FileSystemDirectory(url: directory.url.appendingPathComponent(name))
|
|
346
|
+
try newDirectory.create(CreateOptions())
|
|
347
|
+
return newDirectory
|
|
348
|
+
}
|
|
349
|
+
|
|
338
350
|
Property("uri") { directory in
|
|
339
351
|
return directory.url.absoluteString
|
|
340
352
|
}
|
package/ios/FileSystemPath.swift
CHANGED
|
@@ -25,7 +25,7 @@ internal class FileSystemPath: SharedObject {
|
|
|
25
25
|
|
|
26
26
|
func validateCanCreate(_ options: CreateOptions) throws {
|
|
27
27
|
if try !options.overwrite && exists {
|
|
28
|
-
throw FileAlreadyExistsException(
|
|
28
|
+
throw FileAlreadyExistsException(url.absoluteString)
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d3f99d83252bbc8fcf013f07d3d86ea8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
464959bdf2015e626f82e9af6c6c28a6498240e3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4177d9bd9a22a528b97cc2f2bd7ba47f6cbf7fb1c09d93a1cacdce6f553b05d6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6cac7b2fa58a18696e1468e4e9afe7e6092ca1a404351400345349e028cbaeda51386f4303d05372a2be2baf8de77fd97490ea91caa74bfc2a8cfe7b62619bfe
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
083a9a998bd18c4424272ba3827a26ee
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0d42a8415fa94ce162b33e740bb63f1602d7cc21
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
addebabe9511120923e9a0f4490c31306162dc95ae60cb64867a27847d99dfaf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
66cca546f6f55437628c6fad443bb817e5c0eef007414292fed3f907c68b11d718a3f3d816ee0ea78835567fdaa5686f525ab9f1a27137d5f799b9459d9719d1
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.filesystem",
|
|
6
|
-
"version": "19.0.
|
|
6
|
+
"version": "19.0.19",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
],
|
|
76
76
|
"files": [
|
|
77
77
|
{
|
|
78
|
-
"name": "expo.modules.filesystem-19.0.
|
|
79
|
-
"url": "expo.modules.filesystem-19.0.
|
|
80
|
-
"size":
|
|
81
|
-
"sha512": "
|
|
82
|
-
"sha256": "
|
|
83
|
-
"sha1": "
|
|
84
|
-
"md5": "
|
|
78
|
+
"name": "expo.modules.filesystem-19.0.19.aar",
|
|
79
|
+
"url": "expo.modules.filesystem-19.0.19.aar",
|
|
80
|
+
"size": 393129,
|
|
81
|
+
"sha512": "66cca546f6f55437628c6fad443bb817e5c0eef007414292fed3f907c68b11d718a3f3d816ee0ea78835567fdaa5686f525ab9f1a27137d5f799b9459d9719d1",
|
|
82
|
+
"sha256": "addebabe9511120923e9a0f4490c31306162dc95ae60cb64867a27847d99dfaf",
|
|
83
|
+
"sha1": "0d42a8415fa94ce162b33e740bb63f1602d7cc21",
|
|
84
|
+
"md5": "083a9a998bd18c4424272ba3827a26ee"
|
|
85
85
|
}
|
|
86
86
|
]
|
|
87
87
|
},
|
|
@@ -153,13 +153,13 @@
|
|
|
153
153
|
],
|
|
154
154
|
"files": [
|
|
155
155
|
{
|
|
156
|
-
"name": "expo.modules.filesystem-19.0.
|
|
157
|
-
"url": "expo.modules.filesystem-19.0.
|
|
158
|
-
"size":
|
|
159
|
-
"sha512": "
|
|
160
|
-
"sha256": "
|
|
161
|
-
"sha1": "
|
|
162
|
-
"md5": "
|
|
156
|
+
"name": "expo.modules.filesystem-19.0.19.aar",
|
|
157
|
+
"url": "expo.modules.filesystem-19.0.19.aar",
|
|
158
|
+
"size": 393129,
|
|
159
|
+
"sha512": "66cca546f6f55437628c6fad443bb817e5c0eef007414292fed3f907c68b11d718a3f3d816ee0ea78835567fdaa5686f525ab9f1a27137d5f799b9459d9719d1",
|
|
160
|
+
"sha256": "addebabe9511120923e9a0f4490c31306162dc95ae60cb64867a27847d99dfaf",
|
|
161
|
+
"sha1": "0d42a8415fa94ce162b33e740bb63f1602d7cc21",
|
|
162
|
+
"md5": "083a9a998bd18c4424272ba3827a26ee"
|
|
163
163
|
}
|
|
164
164
|
]
|
|
165
165
|
},
|
|
@@ -173,13 +173,13 @@
|
|
|
173
173
|
},
|
|
174
174
|
"files": [
|
|
175
175
|
{
|
|
176
|
-
"name": "expo.modules.filesystem-19.0.
|
|
177
|
-
"url": "expo.modules.filesystem-19.0.
|
|
178
|
-
"size":
|
|
179
|
-
"sha512": "
|
|
180
|
-
"sha256": "
|
|
181
|
-
"sha1": "
|
|
182
|
-
"md5": "
|
|
176
|
+
"name": "expo.modules.filesystem-19.0.19-sources.jar",
|
|
177
|
+
"url": "expo.modules.filesystem-19.0.19-sources.jar",
|
|
178
|
+
"size": 29329,
|
|
179
|
+
"sha512": "6cac7b2fa58a18696e1468e4e9afe7e6092ca1a404351400345349e028cbaeda51386f4303d05372a2be2baf8de77fd97490ea91caa74bfc2a8cfe7b62619bfe",
|
|
180
|
+
"sha256": "4177d9bd9a22a528b97cc2f2bd7ba47f6cbf7fb1c09d93a1cacdce6f553b05d6",
|
|
181
|
+
"sha1": "464959bdf2015e626f82e9af6c6c28a6498240e3",
|
|
182
|
+
"md5": "d3f99d83252bbc8fcf013f07d3d86ea8"
|
|
183
183
|
}
|
|
184
184
|
]
|
|
185
185
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9ad07458d4659814f2421a509fa6a792
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
da49b182a2c54ca1d319d1423030379f2e21fd32
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
eb38c3d587768d2bb6c4875b3ac850e563d5c16bfc72a58caa43d640a98a8d82
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
994f17cf2e7bafc67a5dfe8da8ddb830fcf84f840de3189001dcd33485030518b0750327667a2654b81decd7141149f20b06049556391c4a4f01566e1a42552a
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.filesystem</artifactId>
|
|
12
|
-
<version>19.0.
|
|
12
|
+
<version>19.0.19</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.filesystem</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e874f8c949394f252e9a031f407ab9af
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8e0e6874c183a04dc7f0d6a654c84cef8cfa1383
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
05cce690d4d0867cb40c77c721fc5a4b230ac7da9cd32f2dde028e2392fa37c6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
566ce5c3da79dba6f5d4f7fd9ef02d10857abb2f683b1663103fe8ab2584e62c6195899b2b139e4656f92eb9f7259a8c98b39d82e71b8e5619f5867eaa5efc12
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.filesystem</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>19.0.
|
|
7
|
-
<release>19.0.
|
|
6
|
+
<latest>19.0.19</latest>
|
|
7
|
+
<release>19.0.19</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>19.0.
|
|
9
|
+
<version>19.0.19</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20251118163421</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
beae1b25d8445f088e6cf6a14bad3166
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4f66326831559e3af8d0e8f219011d3017d7bdd7
|
package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d57c2792e574c8881703bac21f64002916593f57ac51d3c0e62d035c00b94443
|
package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
cacfe25d679304708c44a4c00b209888891926dc57722c2cfeb8e28e042a53985082be9453032c5fa3850f925d8f11938ad2c3675412783cee3e6a27f43b4939
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-file-system",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.19",
|
|
4
4
|
"description": "Provides access to the local file system on the device.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"expo": "*",
|
|
43
43
|
"react-native": "*"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "aecf0c36c0342e1e050328b86dddfeec0041ec0b"
|
|
46
46
|
}
|
|
@@ -207,7 +207,7 @@ export declare class File {
|
|
|
207
207
|
* Retrieves content of the file as base64.
|
|
208
208
|
* @returns A promise that resolves with the contents of the file as a base64 string.
|
|
209
209
|
*/
|
|
210
|
-
base64(): string
|
|
210
|
+
base64(): Promise<string>;
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
213
|
* Retrieves content of the file as base64.
|
|
@@ -217,13 +217,13 @@ export declare class File {
|
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* Retrieves byte content of the entire file.
|
|
220
|
-
* @returns A promise that resolves with the contents of the file as a Uint8Array
|
|
220
|
+
* @returns A promise that resolves with the contents of the file as a `Uint8Array`.
|
|
221
221
|
*/
|
|
222
222
|
bytes(): Promise<Uint8Array<ArrayBuffer>>;
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
225
|
* Retrieves byte content of the entire file.
|
|
226
|
-
* @returns
|
|
226
|
+
* @returns The contents of the file as a `Uint8Array`.
|
|
227
227
|
*/
|
|
228
228
|
bytesSync(): Uint8Array;
|
|
229
229
|
|
|
@@ -284,10 +284,18 @@ export declare class File {
|
|
|
284
284
|
/**
|
|
285
285
|
* A static method that downloads a file from the network.
|
|
286
286
|
*
|
|
287
|
+
* On Android, the response body streams directly into the target file. If the download fails after
|
|
288
|
+
* it starts, a partially written file may remain at the destination. On iOS, the download first
|
|
289
|
+
* completes in a temporary location and the file is moved into place only after success, so no
|
|
290
|
+
* file is left behind when the request fails.
|
|
291
|
+
*
|
|
287
292
|
* @param url - The URL of the file to download.
|
|
288
293
|
* @param destination - The destination directory or file. If a directory is provided, the resulting filename will be determined based on the response headers.
|
|
294
|
+
* @param options - Download options. When the destination already contains a file, the promise rejects with a `DestinationAlreadyExists` error unless `options.idempotent` is set to `true`. With `idempotent: true`, the download overwrites the existing file instead of failing.
|
|
289
295
|
*
|
|
290
|
-
* @returns A promise that resolves to the downloaded file.
|
|
296
|
+
* @returns A promise that resolves to the downloaded file. When the server responds with
|
|
297
|
+
* a non-2xx HTTP status, the promise rejects with an `UnableToDownload` error whose
|
|
298
|
+
* message includes the status code. No file is created in that scenario.
|
|
291
299
|
*
|
|
292
300
|
* @example
|
|
293
301
|
* ```ts
|
|
@@ -307,7 +315,7 @@ export declare class File {
|
|
|
307
315
|
*
|
|
308
316
|
* @param initialUri An optional URI pointing to an initial folder on which the file picker is opened.
|
|
309
317
|
* @param mimeType A mime type that is used to filter out files that can be picked out.
|
|
310
|
-
* @returns
|
|
318
|
+
* @returns A `File` instance or an array of `File` instances.
|
|
311
319
|
*/
|
|
312
320
|
static pickFileAsync(initialUri?: string, mimeType?: string): Promise<File | File[]>;
|
|
313
321
|
|
|
@@ -335,6 +343,11 @@ export declare class File {
|
|
|
335
343
|
* A mime type of the file. An empty string if the file does not exist, or it cannot be read.
|
|
336
344
|
*/
|
|
337
345
|
type: string;
|
|
346
|
+
/**
|
|
347
|
+
* A content URI to the file that can be shared to external applications.
|
|
348
|
+
* @platform android
|
|
349
|
+
*/
|
|
350
|
+
contentUri: string;
|
|
338
351
|
}
|
|
339
352
|
|
|
340
353
|
export declare class FileHandle {
|
package/src/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4524189007ee5743a9177629d95ce8f7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a4e0092c3207d31f4b1117eddee4bf753fdb96f0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fd56e8219c4f981d84e5dfa36830c59279bf486acfcc80c143b18ec1860260e3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2f568bfaeec3afab683022062a45f4bc0b36c57b34b03c594770668d0b7a85542a7c8ef9d7ea015a0ca2b1cefdfdd6c81af52d5a8cb986734006c731cbd2efb0
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
676ac9e485b903778ac23c483eac4cf5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b04ea6436b34d528574e89f14e16e0f214d73d01
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
202752b28c46047281346722d634f17d97177e857bee9905d2637127213146b3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d60c88e7f21f358f02194c14c3927265dfe2d1d87fc6b95752762eac2e0b58aacd0e978c76b0dcf63a8307024d4c456905e7e6e8525b69311b92c4e923ee1877
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5cb1b41174a95bb332168c2b454b738a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e5dca86620c0cfa44a331a228dece9f6fb707255
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
96cddf04f0e45e8dfce4f0fbbc793c6b55afa8a55405b99edc219e5bb728e453
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
922aa61af92925bba9e2969bed8aa22a811d89a6a521bd1e2e1df2d9dfd1f16d32617338b1f8d73f1e174261e6bc7449b4b7442ca074a634fb5f52102502bd25
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
15da0a7b58e0856e5d1770289212732e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bcbc3e44095734fa2fc9cd2934a7985711016d47
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
afb0ac02c4f2628974a286eb1cf14b9168195d1176fdd3a514b633b8a36a5850
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
536ed054e93b501e5884581d1b7b8e91e3a602761126b35e892f66690e007b3f86c95554d3ea3ff322c9e9449c2f7b8948a47563a358cdacdcb139ba0f8d5465
|