我不知道如何根据 ID 删除 Google 站点。我想我需要SiteEntry
为该站点创建并调用delete()
方法,但不知道如何SiteEntry
仅使用 ID 创建。
这就是我创建网站的方式:
SitesService client = new SitesService("domain-AppName-v1");
client.setUserCredentials("adminUSer@domain.com", "password");
//Define Site
SiteEntry entry = new SiteEntry();
entry.setTitle(new PlainTextConstruct("Accounting 001"));
entry.setSummary(new PlainTextConstruct("Accounting 001"));
entry.getCategories().add(new Category(TagCategory.Scheme.TAG, "Course Sessions", null));
//Create the site
SiteEntry result = client.insert(new URL("https://sites.google.com/feeds/site/domain.com/"), entry);
//This Delete does not work
result.delete();
//Trying to setup the id in a SiteEntry, it doesn't work either
SiteEntry e = new SiteEntry();
e.setId(result.getId());
e.delete();