Java - Google API - Publish a document

前端 未结 1 1274
抹茶落季
抹茶落季 2021-01-16 06:06

I have a problem uploading information using the Google Document API. The task is to upload a document, then publish it right after the upload. The first part I have solved,

相关标签:
1条回答
  • 2021-01-16 06:35

    Sharing is done by modifying the document's ACL, more information can be found in the developer's guide.

    Using the Java client library, to make a document read-only for everybody, you can do:

    AclEntry aclEntry = new AclEntry();
    aclEntry.setRole(AclRole.READER);
    aclEntry.setScope(new AclScope(AclScope.Type.DEFAULT, null));
    URL url = new URL(documentEntry.getAclFeedLink().getHref);
    
    return service.insert(url, aclEntry);
    
    0 讨论(0)
提交回复
热议问题