Can someone please help? If this proves to difficult to read please provide a link to a JAVA example for deleting a ACL feed url with an example feed. Thank you!
-------current code - i.e. I hardcoded the feedurl so you can see it i obtained this through interactive debugging.
public Boolean removeDocsShare(){
if (this.getLogEnabled().equals("true")) { this.get_commonUtils().get_httpLogger().log(this.get_commonUtils().get_httpLogger().getLevel(), "[CALL - " + logCount++ + "]-->removeDocsShare in method"); }
Boolean complete = false;
Properties prop = this.get_commonUtils().getProps();
DocsService sourceService = this.authenticateCredentials("SOURCE");
DocumentListFeed allNodes = getAllNodes(sourceService, "SOURCE");
int entryCount = 1;
int totalEntries = allNodes.getEntries().size();
for (DocumentListEntry entry : allNodes.getEntries()) {
String logValues = "Removing Shared Source DocumentListEntry # -" + entryCount + " of " + totalEntries + "]";
if (this.getLogEnabled().equals("true") && this.getLogValues().equals("true")) { this.get_commonUtils().get_httpLogger().log(this.get_commonUtils().get_httpLogger().getLevel(), logValues); }
try {
String aclfeed = entry.getAclFeedLink().getHref();
AclFeed feed = sourceService.getFeed(new URL(aclfeed), AclFeed.class);
for (AclEntry aentry : feed.getEntries()){
logValues = " Doc Name - [" + entry.getTitle().getPlainText() + "] ACL Name - [" + aentry.getTitle().getPlainText() + "] Scope id - [" + aentry.getId() + "] Scope Value - [" + aentry.getScope().getValue() + "] Scope Type (" + aentry.getScope().getType() + ") : Role Value - [" + aentry.getRole().getValue() + "]";
if (this.getLogEnabled().equals("true") && this.getLogValues().equals("true")) { this.get_commonUtils().get_httpLogger().log(this.get_commonUtils().get_httpLogger().getLevel(), logValues); }
if (aentry.getScope().getValue().contains(prop.getProperty("SOURCEDOMAIN"))){
//AclScope scope = new AclScope(AclScope.Type.USER, prop.getProperty("DESTEMAIL")); //this line needs to change to object.currentUser - TODO pwf 03192012
String username = this.get_currentUser() + "@" + prop.getProperty("DESTDOMAIN"); //changed :)
AclScope scope = new AclScope(AclScope.Type.USER, username);
sourceService.delete(new URL(aclfeed), scope);
}
}
complete = true;
} catch (Exception e) {
e.printStackTrace();
}
entryCount++;
}
if (this.getLogEnabled().equals("true")) { this.get_commonUtils().get_httpLogger().log(this.get_commonUtils().get_httpLogger().getLevel(), "[CALL - " + logCount++ + "]-->removeDocsShare out method"); }
return complete;
}
com.google.gdata.util.AuthenticationException: Unknown authorization header
<HTML>
<HEAD>
<TITLE>Unknown authorization header</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unknown authorization header</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:600)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
at com.google.gdata.client.Service.delete(Service.java:1738)
at com.google.gdata.client.GoogleService.delete(GoogleService.java:691)
at com.google.gdata.client.Service.delete(Service.java:1700)
at com.google.gdata.client.GoogleService.delete(GoogleService.java:676)
at com.google.gdata.client.docs.DocsService.delete(DocsService.java:269)
at com.mwp.google.tools.documents.Documents.removeDocsShare(Documents.java:1152)
at com.mwp.google.tools.documents.Documents.delegateMigrate(Documents.java:420)
at com.mwp.google.tools.delegate.DelegateCommands.executeCommandArgs(DelegateCommands.java:193)
at com.mwp.google.tools.delegate.DelegateCommands.executeCommand(DelegateCommands.java:168)
at com.mwp.google.tools.delegate.DelegateCommands.run(DelegateCommands.java:229)
at com.mwp.google.tools.delegate.DelegateCommands.main(DelegateCommands.java:284)