I want to upload new file under a given path if path does not exist , i want to create that path by creating directories, and then upload that file, If path exist i just want to put my file on that path.
for. e.g. 'pandora' is name of my main folder on google drive i want to do all the directory and file manipulations under it.
folderPath = /panodra/augusta/weber/
fileName = DEC
in following method i am trying to find out 'pandora' folder but it is returning empty item list.
private static boolean isFolderExist(String folderPath, String fileName) throws IOException {
Files.List request = drive.files().list().setQ(
"mimeType='application/vnd.google-apps.folder' and trashed=false and title='pandora' ");
FileList files = request.execute();
List<File> fl1 = files.getItems();
System.out.println(fl1);
System.out.println(files);
return false;
}