org.stanwood.media.store.xmlstore
Class BaseXMLStore

java.lang.Object
  extended by org.stanwood.media.xml.XMLParser
      extended by org.stanwood.media.store.xmlstore.BaseXMLStore
Direct Known Subclasses:
XMLStore2

public abstract class BaseXMLStore
extends XMLParser

This is the base class for the XML Store classes. It has the methods which are common between the different store classes.


Field Summary
 
Fields inherited from class org.stanwood.media.xml.XMLParser
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION
 
Constructor Summary
BaseXMLStore()
           
 
Method Summary
protected  java.io.File getCacheFile(java.io.File cacheDirectory, java.lang.String filename)
          Used to get a file object which points to a cache file.
protected  java.lang.String urlToText(java.net.URL url)
          Used to convert a URL into text.
protected  void writeCache(java.io.File file, org.w3c.dom.Document doc)
          Used to write the case document to a file
 
Methods inherited from class org.stanwood.media.xml.XMLParser
createDocBuilder, createFactory, deleteNode, domToStr, encodeAttributeValue, firstChild, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseXMLStore

public BaseXMLStore()
Method Detail

writeCache

protected void writeCache(java.io.File file,
                          org.w3c.dom.Document doc)
                   throws StoreException
Used to write the case document to a file

Parameters:
file - The file to write it to
doc - The contents to write
Throws:
StoreException - Thrown if their is a problem writing the cache

getCacheFile

protected java.io.File getCacheFile(java.io.File cacheDirectory,
                                    java.lang.String filename)
Used to get a file object which points to a cache file.

Parameters:
cacheDirectory - The directory the cache is located in
filename - The filename of the cache
Returns:
The file object pointing to the cache file.

urlToText

protected java.lang.String urlToText(java.net.URL url)
Used to convert a URL into text. If the URL is null, then a empty string is returned. This should be used for writing url's too the XML document.

Parameters:
url - The URL to convert to text.
Returns:
The url as a string, or a empty string if the url was null.