public class SitemapIndexGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SitemapIndexGenerator.Options
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 baseUrl,
File outFile)
Configures the generator with a base URL and destination to write the sitemap index file.
|
SitemapIndexGenerator(URL baseUrl,
File outFile)
Configures the generator with a base URL and destination to write the sitemap index file.
|
| Modifier and Type | Method and Description |
|---|---|
SitemapIndexGenerator |
addUrl(SitemapIndexUrl url)
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(String url)
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(String url,
Date lastMod)
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(URL url)
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrl(URL url,
Date lastMod)
Adds a single sitemap to the index
|
SitemapIndexGenerator |
addUrls(Iterable<? extends SitemapIndexUrl> urls)
Add multiple sitemaps to the index
|
SitemapIndexGenerator |
addUrls(SitemapIndexUrl... urls)
Add multiple sitemaps to the index
|
SitemapIndexGenerator |
addUrls(String... urls)
Add multiple sitemaps to the index
|
SitemapIndexGenerator |
addUrls(String prefix,
String suffix,
int count)
Add a numbered list of sitemaps to the index, e.g.
|
SitemapIndexGenerator |
addUrls(URL... urls)
Add multiple sitemaps to the index
|
void |
write()
Writes out the sitemap index
|
public static final int MAX_SITEMAPS_PER_INDEX
public SitemapIndexGenerator(URL baseUrl, File outFile)
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLoutFile - The sitemap index will be written out at this locationpublic SitemapIndexGenerator(String baseUrl, File outFile) throws MalformedURLException
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLoutFile - The sitemap index will be written out at this locationMalformedURLExceptionpublic SitemapIndexGenerator addUrl(SitemapIndexUrl url)
public SitemapIndexGenerator addUrls(Iterable<? extends SitemapIndexUrl> urls)
public SitemapIndexGenerator addUrls(SitemapIndexUrl... urls)
public SitemapIndexGenerator addUrls(String... urls) throws MalformedURLException
MalformedURLExceptionpublic SitemapIndexGenerator addUrl(String url) throws MalformedURLException
MalformedURLExceptionpublic SitemapIndexGenerator addUrls(URL... urls)
public SitemapIndexGenerator addUrl(URL url)
public SitemapIndexGenerator addUrl(URL url, Date lastMod)
public SitemapIndexGenerator addUrl(String url, Date lastMod) throws MalformedURLException
MalformedURLExceptionpublic SitemapIndexGenerator addUrls(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()
Copyright © 2015. All rights reserved.