public class HeaderCheckWorker extends Object
Note that this class is not thread safe.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUMBER_OF_RETAINED_HEADER_LINES
The default number of header lines to read while looking for the license
information.
|
Constructor and Description |
---|
HeaderCheckWorker(Reader reader,
Collection<ILicense> licenses,
Document name)
Convenience constructor wraps given
Reader in a
BufferedReader . |
HeaderCheckWorker(Reader reader,
int numberOfRetainedHeaderLine,
Collection<ILicense> licenses,
Document document)
Constructs a check worker for the license against the specified document.
|
Modifier and Type | Method and Description |
---|---|
void |
read()
Read the input and perform the header check.
|
static IHeaders |
readHeader(BufferedReader reader,
int numberOfLines)
Read the input and perform the header check.
|
public static final int DEFAULT_NUMBER_OF_RETAINED_HEADER_LINES
public HeaderCheckWorker(Reader reader, Collection<ILicense> licenses, Document name)
Reader
in a
BufferedReader
.reader
- The reader on the document. not null.licenses
- The licenses to check against. not null.name
- The document that is being checked. possibly nullpublic HeaderCheckWorker(Reader reader, int numberOfRetainedHeaderLine, Collection<ILicense> licenses, Document document)
reader
- The reader on the document. not null.numberOfRetainedHeaderLine
- the maximum number of lines to read to find
the license information.licenses
- The licenses to check against. not null.document
- The document that is being checked. possibly nullpublic static IHeaders readHeader(BufferedReader reader, int numberOfLines) throws IOException
reader
- The reader for the document.numberOfLines
- the number of lines to read from the header.IOException
- on input failurepublic void read() throws RatHeaderAnalysisException
RatHeaderAnalysisException
- on IO Exception.Copyright © 2006–2024 Apache Software Foundation. All rights reserved.