public class SimpleCommandProcessor extends java.lang.Object implements Processor
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
command |
static java.lang.String |
OUTPUT_DIR_NAME |
protected boolean |
useOutputFileName |
Constructor and Description |
---|
SimpleCommandProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
configure(java.util.Properties props)
Configure the Processor, providing the details needed to process logs.
|
java.lang.String |
getDirName()
Get the name of the directory where the output of the processor is
placed.
|
java.lang.String |
getOutputFileName(java.lang.String inputFileName)
Get the name that will be assigned to an output file, given the input
file name.
|
void |
process(java.io.File in,
java.io.File out)
Process the files in the input directory and place them in the output
directory.
|
void |
process(java.util.List<java.io.File> in,
java.io.File out)
Process the files in the given list and place them in the output
directory.
|
protected void |
processFileList(java.util.List<java.io.File> files,
java.io.File out)
Run the given command on the list of provided files.
|
protected boolean |
validateCommand()
Validate the currently specified command to run.
|
boolean |
verifyConfiguration()
Verify that the Processor has been properly configured.
|
public static final java.lang.String OUTPUT_DIR_NAME
protected java.lang.String command
protected boolean useOutputFileName
public void process(java.io.File in, java.io.File out) throws ProcessingException
Processor
process
in interface Processor
in
- The directory containing the input filesout
- The directory where output is placedProcessingException
- If an error occurs.gov.nasa.pds.report.processing.Processor.process()
public void process(java.util.List<java.io.File> in, java.io.File out) throws ProcessingException
Processor
process
in interface Processor
in
- A List
of File
objects
pointing to files that will be processedout
- The directory where output is placedProcessingException
- If an error occurs.gov.nasa.pds.report.processing.Processor.process()
public java.lang.String getDirName()
Processor
getDirName
in interface Processor
gov.nasa.pds.report.processing.Processor.getDirName()
public void configure(java.util.Properties props) throws ProcessingException
Processor
configure
in interface Processor
props
- A Properties
containing the needed
configuration values.ProcessingException
- If the provided Properties do not contain
the needed configuration values.gov.nasa.pds.report.processing.Processor.configure()
public java.lang.String getOutputFileName(java.lang.String inputFileName)
Processor
getOutputFileName
in interface Processor
inputFileName
- The name of the input fileTODO: Make this more robust or figure out a better way to determine how
files will be renamed. Perhaps include something to specify this in
configuration. For example, we could specify the gunzip renaming with a
config value of -<.gz>+<>. The value to untar a text file might
look like -+.
public boolean verifyConfiguration()
Processor
verifyConfiguration
in interface Processor
gov.nasa.pds.report.processing.Processor.verifyConfiguration()
protected void processFileList(java.util.List<java.io.File> files, java.io.File out) throws ProcessingException
files
- A List
of File
s to processout
- A File object pointing to the directory
where output is placedProcessingException
- If an error occursprotected boolean validateCommand()
Copyright © 2010-2019 Planetary Data System. All Rights Reserved.