List<GsaEntry> entries = new LinkedList<GsaEntry>();
Integer startLine = 0;
queries.put(Terms.QUERY_MAX_LINES, "500");
GsaFeed feed;
do {
queries.put(Terms.QUERY_START_LINE, startLine.toString());
feed = gsaClient.queryFeed(Terms.FEED_POLICY_ACLS, queries);
entries.addAll(feed.getEntries());
startLine += 500;
} while (feed.getEntries().size() > 0);
for (GsaEntry entry : entries) {
gsaClient.deleteEntry(Terms.FEED_POLICY_ACLS,
entry.getGsaContent(Terms.PROPERTY_URL_PATTERN));
System.out.println("Cleared rule " + entry.getGsaContent(Terms.PROPERTY_URL_PATTERN));