The problem is similar to this post(Documents deleted using Google Docs API still visible in Google Drive can't really get it working with the solutions suggested. When we delete a file using delete() function, whether or not the file got deleted is not the question here, the problem is the file will always be visible in the web browser and can not even be removed manually. I was wondering is there a way to delete the file but also make it disappear in the web UI?
Thanks a lot.
In the v3 API, you should be able to delete a file by using its id. Don't forget to call execute() on the Delete object returned by service.files().delete().
import com.google.api.services.drive.model.*;
import com.google.api.services.drive.Drive;
Drive service = ...;
com.google.api.services.drive.model.File file = ...;
service.files().delete(file.getId()).execute();
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