我是 google doc api 的新手,并且使用 google doc api 3rd version with java ,
I m trying to share doc with permission and want to change permission on different call,
Here there is some code which i had designed to share persmission and update and delete permission , but some how i wil got some problem on each operation,
On first time i can share docs with permission , but once i had share and again try to share with other permission then it cant allow me to upda so what should be i missing at here ,
AclEntry acl = new AclEntry();
AclScope aclScope = new AclScope(AclScope.Type.USER,"xyz@gmail.com");
acl.setScope(aclScope);
//AclRole aclRole = new AclRole();
acl.setRole(AclRole.READER);
URL url = buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + "/" + folderResId + URL_FOLDERS + "/" + entry.getResourceId());
System.out.println(url.toString());
System.out.println("url : "+entry.getAclFeedLink().getHref());
// For Insert
//service.insert(new URL(entry.getAclFeedLink().getHref()), acl);
// For Update
//service.getRequestFactory().setHeader("If-Match", "*");
//service.update(new URL(entry.getEditLink().getHref()), acl);
// For Delete
service.getRequestFactory().setHeader("If-Match", "*");
service.delete(new URL(entry.getEditLink().getHref()), aclScope);
after insert first tim eif itry to insert again i wil get this error..
com.google.gdata.util.VersionConflictException: This user already has access to the document.
After insert if i try to delete that then i wil get this error
com.google.gdata.util.InvalidEntryException: Unexpected resource version ID
thnaks in advance,