URL updateUrl = new URL(getSitesFeedUrl() + siteId);
try {
// Update geographic location
System.out.println("Updating geographic location...");
SitesEntry entryUpdate = new SitesEntry();
entryUpdate.setGeolocation(SAMPLE_LOCATION);
myService.update(updateUrl, entryUpdate);
// Update desired crawl rate
System.out.println("Updating desired crawl rate...");
entryUpdate = new SitesEntry();
entryUpdate.setCrawlRate(SAMPLE_RATE);
myService.update(updateUrl, entryUpdate);
// Update preferred domain
System.out.println("Updating preferred domain...");
entryUpdate = new SitesEntry();
entryUpdate.setPreferredDomain(SAMPLE_PREFERRED_DOMAIN);
myService.update(updateUrl, entryUpdate);
// Update enhanced image search and return the last updated entry
System.out.println("Updating enhanced image search...");
entryUpdate = new SitesEntry();
entryUpdate.setEnhancedImageSearch(SAMPLE_ENHANCED_IMAGE_SEARCH);
return myService.update(updateUrl, entryUpdate);
} catch (ServiceException e) {
System.out.println("Please make sure that the site to update "
+ "contains a trailing forward slash");
throw(e);