.setFields("nextPageToken, newStartPageToken, changes(removed, fileId, file(" + REQUEST_FILE_FIELDS + "))"); request.setRestrictToMyDrive(true); request.setIncludeRemoved(true); ChangeList changes; do { changes = request.execute(); result.addAll(changes.getChanges()); request.setPageToken(changes.getNextPageToken()); } while (request.getPageToken() != null && request.getPageToken().length() > 0); final String lastPageToken = changes.getNewStartPageToken(); return toGChanges(lastPageToken, result);
/** * Lists the changes for a user or Team Drive. * * Create a request for the method "changes.list". * * This request holds the parameters needed by the drive server. After setting any optional * parameters, call the {@link List#execute()} method to invoke the remote operation. * * @param pageToken The token for continuing a previous list request on the next page. This should be set to the value * of 'nextPageToken' from the previous response or to the response from the * getStartPageToken method. * @return the request */ public List list(java.lang.String pageToken) throws java.io.IOException { List result = new List(pageToken); initialize(result); return result; }