MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / exists

Method exists

src/plugins/sdcard/src/android/SDcard.java:1056–1068  ·  view source on GitHub ↗
(String path, CallbackContext callback)

Source from the content-addressed store, hash-verified

1054 }
1055
1056 private void exists(String path, CallbackContext callback) {
1057 DocumentFile file = DocumentFile.fromSingleUri(context, Uri.parse(path));
1058
1059 if (file == null) {
1060 callback.error("Unable to get file");
1061 } else {
1062 if (file.exists()) {
1063 callback.success("TRUE");
1064 } else {
1065 callback.success("FALSE");
1066 }
1067 }
1068 }
1069
1070 private void error(String err, CallbackContext callback) {
1071 callback.error("ERROR: " + err);

Callers 1

executeMethod · 0.95

Calls 3

successMethod · 0.80
existsMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected