when inserting a new file in google drive sdk There is no headRevisionId in the return object
the code example :
File file = drive.files().insert(body , mediaContent).execute();
headRevisionId = file.getHeadRevisionId();
will have null in the headRevisionId
while the next code will return the value :
File file = drive.files().insert(body , mediaContent).execute();
File file2 = file = gDriveApiClient.files().get(file.getId()).execute();
headRevisionId = file.getHeadRevisionId();