public class SitemapsOrgGenerator extends AbstractGenerator
bytesWritten, currentOutput, fileCount, outputDir, urlsWritten| Constructor and Description |
|---|
SitemapsOrgGenerator(File outputDirIn,
String urlStem,
String urlTail)
Construct a sitemaps.org protocol sitemap generator, writing files to the
given directory, and with the sitemaps eventually exposed at starting
with the given URL stem and tail.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getFilename(int number)
Return the filename a sitemap at the given index should be stored at.
|
String |
getIndexFilename()
Get the filename the index should be written to.
|
String |
getLeadingBoilerPlate()
Return the boilerplate at the top of a sitemap file.
|
int |
getMaxSize()
Return the maximum size in bytes that an individual sitemap file should
be.
|
int |
getMaxURLs()
Return the maximum number of URLs that an individual sitemap file should
contain.
|
String |
getTrailingBoilerPlate()
Return the boilerplate at the end of a sitemap file.
|
String |
getURLText(String url,
Date lastMod)
Return marked-up text to be included in a sitemap about a given URL.
|
boolean |
useCompression()
Return whether the written sitemap files and index should be
GZIP-compressed.
|
void |
writeIndex(PrintStream output,
int sitemapCount)
Write the index file.
|
addURL, closeCurrentFile, finish, startNewFilepublic SitemapsOrgGenerator(File outputDirIn, String urlStem, String urlTail)
outputDirIn - Directory to write sitemap files tourlStem - start of URL that sitemap files will appear at, e.g.
http://dspace.myu.edu/sitemap?sitemap=urlTail - end of URL that sitemap files will appear at, e.g.
.html or nullpublic String getFilename(int number)
AbstractGeneratorgetFilename in class AbstractGeneratornumber - index of the sitemap file (zero is first).public String getLeadingBoilerPlate()
AbstractGeneratorgetLeadingBoilerPlate in class AbstractGeneratorpublic int getMaxSize()
AbstractGeneratorgetMaxSize in class AbstractGeneratorpublic int getMaxURLs()
AbstractGeneratorgetMaxURLs in class AbstractGeneratorpublic String getTrailingBoilerPlate()
AbstractGeneratorgetTrailingBoilerPlate in class AbstractGeneratorpublic String getURLText(String url, Date lastMod)
AbstractGeneratorgetURLText in class AbstractGeneratorurl - URL to add information aboutlastMod - date URL was last modified, or null if unknown or not
applicablepublic boolean useCompression()
AbstractGeneratoruseCompression in class AbstractGeneratortrue if GZIP compression should be used, false
otherwise.public String getIndexFilename()
AbstractGeneratorgetIndexFilename in class AbstractGeneratorpublic void writeIndex(PrintStream output, int sitemapCount) throws IOException
AbstractGeneratorwriteIndex in class AbstractGeneratoroutput - stream to write the index tositemapCount - number of sitemaps that were generatedIOException - if an IO error occursCopyright © 2015 DuraSpace. All Rights Reserved.