public class HTMLSitemapGenerator extends AbstractGenerator
| Modifier and Type | Field and Description |
|---|---|
protected String |
indexURLStem
Stem of URLs sitemaps will eventually appear at
|
protected String |
indexURLTail
Tail of URLs sitemaps will eventually appear at
|
bytesWritten, currentOutput, fileCount, outputDir, urlsWritten| Constructor and Description |
|---|
HTMLSitemapGenerator(File outputDirIn,
String urlStem,
String urlTail)
Construct an HTML 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, startNewFileprotected String indexURLStem
protected String indexURLTail
public HTMLSitemapGenerator(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 IO error
if an IO error occursCopyright © 2022 LYRASIS. All rights reserved.