edu.sc.seis.sod.status
Class FileWritingTemplate
java.lang.Object
edu.sc.seis.sod.status.Template
edu.sc.seis.sod.status.FileWritingTemplate
- All Implemented Interfaces:
- GenericTemplate, java.lang.Runnable
- Direct Known Subclasses:
- EventStatusTemplate, IndexTemplate, NetworkInfoTemplate, WaveformStatusTemplate
public class FileWritingTemplate
- extends Template
- implements GenericTemplate, java.lang.Runnable
Constructor Summary |
protected |
FileWritingTemplate(java.lang.String baseDir,
java.lang.String loc)
|
Method Summary |
static java.lang.String |
getBaseDirectoryName()
|
java.lang.String |
getFilename()
|
protected java.io.File |
getOutputDirectory()
|
java.lang.String |
getOutputLocation()
|
java.lang.String |
getResult()
|
protected java.lang.Object |
getTemplate(java.lang.String tag,
org.w3c.dom.Element el)
if this class has an template for this tag, it creates it using the
passed in element and returns it. |
void |
run()
|
static java.lang.String |
testOutputLoc(java.lang.String loc)
|
protected java.lang.Object |
textTemplate(java.lang.String text)
returns an object of the template type that this class uses, and returns
the passed in text when the getResult method of that template type is
called |
java.lang.String |
toString()
|
void |
write()
|
static void |
write(java.lang.String outputLocation,
java.lang.String output)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FileWritingTemplate
protected FileWritingTemplate(java.lang.String baseDir,
java.lang.String loc)
throws java.io.IOException
- Throws:
java.io.IOException
testOutputLoc
public static java.lang.String testOutputLoc(java.lang.String loc)
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write()
getResult
public java.lang.String getResult()
- Specified by:
getResult
in interface GenericTemplate
textTemplate
protected java.lang.Object textTemplate(java.lang.String text)
- Description copied from class:
Template
- returns an object of the template type that this class uses, and returns
the passed in text when the getResult method of that template type is
called
- Specified by:
textTemplate
in class Template
getOutputLocation
public java.lang.String getOutputLocation()
getFilename
public java.lang.String getFilename()
getOutputDirectory
protected java.io.File getOutputDirectory()
getTemplate
protected java.lang.Object getTemplate(java.lang.String tag,
org.w3c.dom.Element el)
throws ConfigurationException
- Description copied from class:
Template
- if this class has an template for this tag, it creates it using the
passed in element and returns it. Otherwise it should return
the superclass implementation of the getCommonTemplate method. Though no harm will come
from merely returning null, they won't benefit from the wisdom and extra
tags provided by their elder classes.
- Overrides:
getTemplate
in class Template
- Throws:
ConfigurationException
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
write
public static void write(java.lang.String outputLocation,
java.lang.String output)
getBaseDirectoryName
public static java.lang.String getBaseDirectoryName()