You need to set the following parameters:
private Permission insertPermission(Drive service, String fileId) throws Exception{ Permission newPermission = new Permission(); newPermission.setType("anyone"); newPermission.setRole("reader"); newPermission.setValue(""); newPermission.setWithLink(true); return service.permissions().insert(fileId, newPermission).execute(); }
source share