public class WebSitemapGenerator extends Object
| Constructor and Description |
|---|
WebSitemapGenerator(String baseUrl)
Construct web sitemap.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPage(WebPage webPage)
Add single page to sitemap
|
void |
addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap
|
void |
constructAndSaveSitemap(File file)
Construct and save sitemap to output file
|
String[] |
constructSitemap()
Construct sitemap into array of Strings
|
void |
pingGoogle()
Ping Google that sitemap has changed.
|
void |
pingGoogle(String sitemapUrl)
Ping Google that sitemap has changed.
|
void |
saveSitemap(File file,
String[] sitemap)
Save sitemap to output file
|
public WebSitemapGenerator(String baseUrl)
baseUrl - All URLs must start with this baseUrl, for example
http://www.javavids.compublic void addPage(WebPage webPage)
webPage - single pagepublic void addPages(Collection<WebPage> webPages)
webPages - Collection of pagespublic String[] constructSitemap()
public void saveSitemap(File file, String[] sitemap) throws IOException
file - Output filesitemap - Sitemap as array of Strings (created by constructSitemap()
method)IOExceptionpublic void constructAndSaveSitemap(File file) throws IOException
file - Output fileIOExceptionpublic void pingGoogle(String sitemapUrl)
public void pingGoogle()
Copyright © 2013. All Rights Reserved.