com.bssp.javasitemapper
Class SitemapOutput

java.lang.Object
  extended by com.bssp.javasitemapper.SitemapOutput

public class SitemapOutput
extends java.lang.Object

Class SitemapOutput writes a urlset container to disk as a sitemap.xml file (or a set of sitemap files referenced by a sitemap index file), in addition to formatting the sitemap file(s) so that they are readable.


 To view an example of how to use this class and the other classes of this
 sitemap API, please go to Sitemap.
 

 
 
 Note: In it's current version, the API only allows for the creation of 1 
 index file (which implies only 1000 sitemap files, or based on its current 
 build, only 40,000,000 URLs). We hope to improve functionality in the next 
 version.
 
 

Version:
0.9.9, 2008-11-13
Author:
Victor Ngo
See Also:
Sitemap, SitemapURL, SitemapOutput

Field Summary
static java.lang.String FILE_SITEMAP_DEFAULT
          Constant value "sitemap.xml" used as the default name for sitemaps.
static java.lang.String FILE_SITEMAP_INDEX_DEFAULT
          Constant value "sitemap_index.xml" used as the default name for sitemap index files.
 
Constructor Summary
SitemapOutput()
          This constructor creates a new SitemapOutput object with an undefined domain name, filepath set to the root of the web application, and filename set to "sitemap.xml".
SitemapOutput(java.lang.String customDomain)
          This overloaded constructor creates a new SitemapOutput object with a user-defined domain name, filepath set to the root of the web application, and filename set to "sitemap.xml".
SitemapOutput(java.lang.String customDomain, java.lang.String customURI)
          This overloaded constructor creates a new SitemapOutput object with a user-defined domain name, user-defined filepath, and filename set to "sitemap.xml".
SitemapOutput(java.lang.String customDomain, java.lang.String customURI, java.lang.String customFilename)
          This overloaded constructor creates a new SitemapOutput object with a user-defined domain name, filepath, and filename.
 
Method Summary
 java.lang.String getSitemapDomain()
          This returns the file's domain.
 java.lang.String getSitemapFilename()
          This returns the file's filename.
 java.lang.String getSitemapURI()
          This returns the file's location.
 void output(Sitemap urlSet)
          This method outputs parameter urlSet as a formatted file.
 void setSitemapDomain(java.lang.String sitemapDomain)
          This sets the file's domain.
 void setSitemapFilename(java.lang.String sitemapFilename)
          This sets the file's filename.
 void setSitemapURI(java.lang.String sitemapURI)
          This sets the file's location.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_SITEMAP_DEFAULT

public static final java.lang.String FILE_SITEMAP_DEFAULT
Constant value "sitemap.xml" used as the default name for sitemaps.

See Also:
Constant Field Values

FILE_SITEMAP_INDEX_DEFAULT

public static final java.lang.String FILE_SITEMAP_INDEX_DEFAULT
Constant value "sitemap_index.xml" used as the default name for sitemap index files.

See Also:
Constant Field Values
Constructor Detail

SitemapOutput

public SitemapOutput()
This constructor creates a new SitemapOutput object with an undefined domain name, filepath set to the root of the web application, and filename set to "sitemap.xml".


SitemapOutput

public SitemapOutput(java.lang.String customDomain)
This overloaded constructor creates a new SitemapOutput object with a user-defined domain name, filepath set to the root of the web application, and filename set to "sitemap.xml". The domain name is especially important when you know multiple sitemaps and a sitemap_index.xml file will be created. When defining a domain name, please omit the file separator at the end of your path.

Parameters:
customDomain - a String describing the file's user-specified domain name.

SitemapOutput

public SitemapOutput(java.lang.String customDomain,
                     java.lang.String customURI)
This overloaded constructor creates a new SitemapOutput object with a user-defined domain name, user-defined filepath, and filename set to "sitemap.xml". The domain name is especially important when you know multiple sitemaps and a sitemap_index.xml file will be created. When defining a domain name, please omit the file separator at the end of your path. When defining a filepath location, please include a file separator at the end of your path.

Parameters:
customDomain - a String describing the file's user-specified domain name.
customURI - a String describing the file's user-specified location.

SitemapOutput

public SitemapOutput(java.lang.String customDomain,
                     java.lang.String customURI,
                     java.lang.String customFilename)
This overloaded constructor creates a new SitemapOutput object with a user-defined domain name, filepath, and filename. The domain name is especially important when you know multiple sitemaps and a sitemap_index.xml file will be created. When defining a domain name, please omit the file separator at the end of your path. When defining a filepath location, please include a file separator at the end of your path.

Parameters:
customDomain - a String describing the file's user-specified domain name.
customURI - a String describing the file's user-specified location.
customFilename - a String describing the file's user-specified filename.
Method Detail

output

public void output(Sitemap urlSet)
This method outputs parameter urlSet as a formatted file.

Parameters:
urlSet - an object of type Sitemap that converts all sitemap information into a sitemap.xml file.
Throws:
java.io.IOException - an input/output exception if there is a problem writing the file.

getSitemapFilename

public java.lang.String getSitemapFilename()
This returns the file's filename.

Returns:
sitemapFilename - a String describing the file's filename.

setSitemapFilename

public void setSitemapFilename(java.lang.String sitemapFilename)
This sets the file's filename.

Parameters:
sitemapFilename - a String describing the file's filename.

getSitemapURI

public java.lang.String getSitemapURI()
This returns the file's location.

Returns:
sitemapURI - a String describing the file's location.

setSitemapURI

public void setSitemapURI(java.lang.String sitemapURI)
This sets the file's location. When defining a location, please include a file separator at the end of your path.

Parameters:
sitemapURI - a String describing the file's location.

getSitemapDomain

public java.lang.String getSitemapDomain()
This returns the file's domain.

Returns:
sitemapDomain - a String describing the file's domain.

setSitemapDomain

public void setSitemapDomain(java.lang.String sitemapDomain)
This sets the file's domain. The domain name is especially important when you know multiple sitemaps and a sitemap_index.xml file will be created.

Parameters:
sitemapDomain - a String describing the file's domain.