public class SitemapWriter extends OutputStreamWriter
Modifier and Type | Class and Description |
---|---|
static class |
SitemapWriter.Frequency
Enumeration of update frequencies.
|
Constructor and Description |
---|
SitemapWriter(OutputStream out)
Instantiates a new
SitemapWriter . |
Modifier and Type | Method and Description |
---|---|
void |
writeFooter()
Writes the XML footer.
|
void |
writeHeader()
Writes the XML header.
|
void |
writeUrl(String url,
Date lastmod,
SitemapWriter.Frequency changeFreq,
Float priority)
Writes an URL entry to the XML file.
|
close, flush, getEncoding, write, write, write
public SitemapWriter(OutputStream out) throws IOException
SitemapWriter
.out
- OutputStream
to write toIOException
public void writeHeader() throws IOException
IOException
public void writeUrl(String url, Date lastmod, SitemapWriter.Frequency changeFreq, Float priority) throws IOException
url
- URL of the pagelastmod
- Last modification date, or null
if unknownchangeFreq
- Change frequency, or null
if unknownpriority
- Priority of the page in the sitemap (between 0f and 1f), or null
for default priorityIOException
public void writeFooter() throws IOException
IOException
Copyright © 2012–2016. All rights reserved.