public class GoogleCodeSitemapGenerator extends Object
builder(URL, File)| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_URLS_PER_SITEMAP
50000 URLs per sitemap maximum
|
| Constructor and Description |
|---|
GoogleCodeSitemapGenerator(String baseUrl)
Configures the generator with a base URL and a null directory.
|
GoogleCodeSitemapGenerator(String baseUrl,
File baseDir)
Configures the generator with a base URL and directory to write the sitemap files.
|
GoogleCodeSitemapGenerator(URL baseUrl)
Configures the generator with a base URL and a null directory.
|
GoogleCodeSitemapGenerator(URL baseUrl,
File baseDir)
Configures the generator with a base URL and directory to write the sitemap files.
|
| Modifier and Type | Method and Description |
|---|---|
THIS |
addUrl(String url)
Add one URL of the appropriate type to this sitemap.
|
THIS |
addUrl(U url)
Add one URL of the appropriate type to this sitemap.
|
THIS |
addUrl(URL url)
Add one URL of the appropriate type to this sitemap.
|
THIS |
addUrls(Iterable<? extends U> urls)
Add multiple URLs of the appropriate type to this sitemap, one at a time.
|
THIS |
addUrls(String... urls)
Add multiple URLs of the appropriate type to this sitemap, one at a time.
|
THIS |
addUrls(U... urls)
Add multiple URLs of the appropriate type to this sitemap, one at a time.
|
THIS |
addUrls(URL... urls)
Add multiple URLs of the appropriate type to this sitemap, one at a time.
|
static SitemapGeneratorBuilder<GoogleCodeSitemapGenerator> |
builder(String baseUrl,
File baseDir)
Configures a builder so you can specify sitemap generator options
|
static SitemapGeneratorBuilder<GoogleCodeSitemapGenerator> |
builder(URL baseUrl,
File baseDir)
Configures a builder so you can specify sitemap generator options
|
List<File> |
write()
Write out remaining URLs; this method can only be called once.
|
List<String> |
writeAsStrings()
Writes out the sitemaps as a list of strings.
|
void |
writeSitemapsWithIndex()
After you've called
write(), call this to generate a sitemap index of all sitemaps you generated. |
public static final int MAX_URLS_PER_SITEMAP
public GoogleCodeSitemapGenerator(String baseUrl, File baseDir) throws MalformedURLException
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLbaseDir - Sitemap files will be generated in this directory as either "sitemap.xml" or "sitemap1.xml" "sitemap2.xml" and so on.MalformedURLExceptionpublic GoogleCodeSitemapGenerator(URL baseUrl, File baseDir)
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLbaseDir - Sitemap files will be generated in this directory as either "sitemap.xml" or "sitemap1.xml" "sitemap2.xml" and so on.public GoogleCodeSitemapGenerator(String baseUrl) throws MalformedURLException
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLMalformedURLExceptionpublic GoogleCodeSitemapGenerator(URL baseUrl)
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLpublic static SitemapGeneratorBuilder<GoogleCodeSitemapGenerator> builder(URL baseUrl, File baseDir)
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLbaseDir - Sitemap files will be generated in this directory as either "sitemap.xml" or "sitemap1.xml" "sitemap2.xml" and so on.public static SitemapGeneratorBuilder<GoogleCodeSitemapGenerator> builder(String baseUrl, File baseDir) throws MalformedURLException
baseUrl - All URLs in the generated sitemap(s) should appear under this base URLbaseDir - Sitemap files will be generated in this directory as either "sitemap.xml" or "sitemap1.xml" "sitemap2.xml" and so on.MalformedURLExceptionpublic THIS addUrl(U url)
allowMultipleSitemaps is false,
or else write out one sitemap immediately.url - the URL to add to this sitemappublic THIS addUrls(Iterable<? extends U> urls)
allowMultipleSitemaps is false,
or write out one sitemap immediately.urls - the URLs to add to this sitemappublic THIS addUrls(U... urls)
allowMultipleSitemaps is false,
or write out one sitemap immediately.urls - the URLs to add to this sitemappublic THIS addUrls(String... urls) throws MalformedURLException
allowMultipleSitemaps is false,
or write out one sitemap immediately.urls - the URLs to add to this sitemapMalformedURLExceptionpublic THIS addUrl(String url) throws MalformedURLException
allowMultipleSitemaps is false,
or else write out one sitemap immediately.url - the URL to add to this sitemapMalformedURLExceptionpublic THIS addUrls(URL... urls)
allowMultipleSitemaps is false,
or write out one sitemap immediately.urls - the URLs to add to this sitemappublic THIS addUrl(URL url)
allowMultipleSitemaps is false,
or write out one sitemap immediately.url - the URL to add to this sitemappublic List<File> write()
writeSitemapsWithIndex().public List<String> writeAsStrings()
public void writeSitemapsWithIndex()
write(), call this to generate a sitemap index of all sitemaps you generated.Copyright © 2015. All rights reserved.