-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMxFileSystemModule.kt
More file actions
69 lines (52 loc) · 1.94 KB
/
Copy pathMxFileSystemModule.kt
File metadata and controls
69 lines (52 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.mendixnative.fs
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.module.annotations.ReactModule
import com.mendix.mendixnative.react.fs.NativeFsModule
import com.mendixnative.NativeMxFileSystemSpec
@ReactModule(name = MxFileSystemModule.NAME)
class MxFileSystemModule(reactContext: ReactApplicationContext) :
NativeMxFileSystemSpec(reactContext) {
private val fsModule = NativeFsModule(reactContext)
override fun getName(): String = NAME
override fun getTypedExportedConstants(): Map<String, Any> {
return fsModule.getConstants()
}
override fun save(blob: ReadableMap, filePath: String, promise: Promise) {
fsModule.save(blob, filePath, promise)
}
override fun read(filePath: String, promise: Promise) {
fsModule.read(filePath, promise)
}
override fun move(filePath: String, newPath: String, promise: Promise) {
fsModule.move(filePath, newPath, promise)
}
override fun remove(filePath: String, promise: Promise) {
fsModule.remove(filePath, promise)
}
override fun list(dirPath: String, promise: Promise) {
fsModule.list(dirPath, promise)
}
override fun readAsDataURL(filePath: String, promise: Promise) {
fsModule.readAsDataURL(filePath, promise)
}
override fun readAsText(filePath: String, promise: Promise) {
fsModule.readAsText(filePath, promise)
}
override fun fileExists(filePath: String, promise: Promise) {
fsModule.fileExists(filePath, promise)
}
override fun writeJson(data: ReadableMap, filepath: String, promise: Promise) {
fsModule.writeJson(data, filepath, promise)
}
override fun readJson(filepath: String, promise: Promise) {
fsModule.readJson(filepath, promise)
}
override fun setEncryptionEnabled(enabled: Boolean) {
fsModule.setEncryptionEnabled(enabled)
}
companion object {
const val NAME = "MxFileSystem"
}
}