Package 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
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileWritingTemplate(java.lang.String baseDir, java.lang.String loc)
-
Method Summary
Modifier and Type Method Description 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 calledjava.lang.String
toString()
void
write()
static void
write(java.lang.String outputLocation, java.lang.String output)
-
Constructor Details
-
FileWritingTemplate
protected FileWritingTemplate(java.lang.String baseDir, java.lang.String loc) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
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 interfaceGenericTemplate
-
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 classTemplate
-
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 ConfigurationExceptionDescription 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 classTemplate
- Throws:
ConfigurationException
-
run
public void run()- Specified by:
run
in interfacejava.lang.Runnable
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
write
public static void write(java.lang.String outputLocation, java.lang.String output) -
getBaseDirectoryName
public static java.lang.String getBaseDirectoryName()
-