MCPcopy Create free account
hub / github.com/itinance/react-native-fs / mkdir

Method mkdir

android/src/main/java/com/rnfs/RNFSManager.java:675–691  ·  view source on GitHub ↗
(String filepath, ReadableMap options, Promise promise)

Source from the content-addressed store, hash-verified

673 }
674
675 @ReactMethod
676 public void mkdir(String filepath, ReadableMap options, Promise promise) {
677 try {
678 File file = new File(filepath);
679
680 file.mkdirs();
681
682 boolean exists = file.exists();
683
684 if (!exists) throw new Exception("Directory could not be created");
685
686 promise.resolve(null);
687 } catch (Exception ex) {
688 ex.printStackTrace();
689 reject(promise, filepath, ex);
690 }
691 }
692
693 private void sendEvent(ReactContext reactContext, String eventName, WritableMap params) {
694 reactContext

Callers

nothing calls this directly

Calls 2

rejectMethod · 0.95
existsMethod · 0.45

Tested by

no test coverage detected