public class ApacheCommonProcessor extends java.lang.Object implements Processor
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
COMBINED_REGEX |
protected java.util.regex.Pattern |
combinedPattern |
protected static java.lang.String |
COMMON_REGEX |
protected java.util.regex.Pattern |
commonPattern |
static java.lang.String |
OUTPUT_DIR_NAME |
Constructor and Description |
---|
ApacheCommonProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
configure(java.util.Properties props)
This particular Processor doesn't require any configuration since its
purpose is so specific.
|
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 |
processFile(java.io.File in,
java.io.File outputDir)
Process a given
File , placing the filtered version inside a
given directory. |
protected void |
processFileList(java.util.List<java.io.File> files,
java.io.File out)
Process the provided
List of File s. |
protected boolean |
processLine(ReadWriter rw)
Use the provided reader to read in a line, check if each detail ends
with an at symbol, removing any such characters, and then write it to
output using the provided writer.
|
boolean |
verifyConfiguration()
This particular Processor doesn't require any configuration since its
purpose is so specific.
|
public static final java.lang.String OUTPUT_DIR_NAME
protected static final java.lang.String COMBINED_REGEX
protected static final java.lang.String COMMON_REGEX
protected java.util.regex.Pattern combinedPattern
protected java.util.regex.Pattern commonPattern
public java.lang.String getDirName()
Processor
getDirName
in interface Processor
public java.lang.String getOutputFileName(java.lang.String inputFileName)
Processor
getOutputFileName
in interface Processor
inputFileName
- The name of the input filepublic void configure(java.util.Properties props) throws ProcessingException
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 boolean verifyConfiguration()
verifyConfiguration
in interface Processor
gov.nasa.pds.report.processing.Processor.verifyConfiguration()
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.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.protected void processFileList(java.util.List<java.io.File> files, java.io.File out) throws ProcessingException
List
of File
s.files
- A list of File objects pointing to log
files to be processed.out
- A File
object pointing to the
directory where output will be placed.ProcessingException
- If an error occurs.protected void processFile(java.io.File in, java.io.File outputDir) throws ProcessingException
File
, placing the filtered version inside a
given directory.in
- The File that will be processed.outputDir
- The directory where the output will be
placed, represented as a File
.ProcessingException
- If an error occurs while parsing the input
file or while writing output.protected boolean processLine(ReadWriter rw) throws ProcessingException
rw
- A ReadWriter
that is already
initialized to read and write from the input
and output files.ProcessingException
- If an error occurs.Copyright © 2010-2019 Planetary Data System. All Rights Reserved.