I am trying to create empty folder for my android app..
File body = new File();
body.setTitle("title");
java.io.File fileContent = new java.io.File("title");
FileContent mediaContent = new FileContent("application/vnd.google-apps.folder", fileContent);
File file = service.files().insert(body, mediaContent).execute();
This doesnt seem to work.....
Getting exception:
java.io.FileNotFoundException:/title open failed ENOENT ( no such file or directory)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (no such file or directory)
Solved...
File body = new File();
body.setTitle("title");
body.setMimeType("application/vnd.google-apps.folder");
File file = service.files().insert(body).execute();
It will create folder named title in google drive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With