public class SitemapIndexGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SitemapIndexGenerator
Options to configure sitemap index generation
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SITEMAPS_PER_INDEX
Maximum 50,000 sitemaps per index allowed
|
| Constructor and Description |
|---|
SitemapIndexGenerator(String
Configures the generator with a base URL and destination to write the sitemap index file.
|
SitemapIndexGenerator(URL
Configures the generator with a base URL and destination to write the sitemap index file.
|
| Modifier and Type | Method and Description |
|---|---|
SitemapIndexGenerator |
addUrl(SitemapIndexUrl
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(String
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(String
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(URL
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(URL
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrls(Iterable
Add multiple sitemaps to the index
|
SitemapIndexGenerator |
addUrls(SitemapIndexUrl
Add multiple sitemaps to the index
|
SitemapIndexGenerator |
addUrls(String
Add multiple sitemaps to the index
|
SitemapIndexGenerator |
addUrls(String
Add a numbered list of sitemaps to the index, e.g.
|
SitemapIndexGenerator |
addUrls(URL
Add multiple sitemaps to the index
|
void |
write()
Writes out the sitemap index
|
public static final int MAX_SITEMAPS_PER_INDEX
public SitemapIndexGenerator(URLbaseUrl, File outFile)
baseUrl - All URLs in the generated sitemap(s) should appear under this base URL
outFile - The sitemap index will be written out at this location
public SitemapIndexGenerator(StringbaseUrl, File outFile) throws MalformedURLException
baseUrl - All URLs in the generated sitemap(s) should appear under this base URL
outFile - The sitemap index will be written out at this location
MalformedURLException
public SitemapIndexGeneratoraddUrl(SitemapIndexUrl url)
public SitemapIndexGeneratoraddUrls(Iterable <? extends SitemapIndexUrl > urls)
public SitemapIndexGeneratoraddUrls(SitemapIndexUrl ... urls)
public SitemapIndexGeneratoraddUrls(String ... urls) throws MalformedURLException
MalformedURLException
public SitemapIndexGeneratoraddUrl(String url) throws MalformedURLException
MalformedURLException
public SitemapIndexGeneratoraddUrls(URL ... urls)
public SitemapIndexGeneratoraddUrl(URL url)
public SitemapIndexGeneratoraddUrl(URL url, Date lastMod)
public SitemapIndexGeneratoraddUrl(String url, Date lastMod) throws MalformedURLException
MalformedURLException
public SitemapIndexGeneratoraddUrls(String prefix, String suffix, int count)
prefix - the first part of the filename e.g. "sitemap"
suffix - the last part of the filename e.g. ".xml" or ".xml.gz"
count - the number of sitemaps (1-based)
public void write()