| 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 |