- java.lang.Object
-
- com.pervasive.datarush.operators.io.textfile.FormatAnalyzer
-
- Direct Known Subclasses:
ELFAnalyzer
public class FormatAnalyzer extends Object
A generic format analyzer for log files. Will read the first line to determine the newline character.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FormatAnalyzer.FormatAnalysis
Contains the results of analyzing a file.
-
Constructor Summary
Constructors Constructor Description FormatAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatAnalyzer.FormatAnalysis
analyze(Path file, CharsetEncoding encoding)
Analyze the specified file expecting the described character set encoding.FormatAnalyzer.FormatAnalysis
analyze(Path file, CharsetEncoding encoding, FileClient client)
Analyze the specified file expecting the described character set encoding.FormatAnalyzer.FormatAnalysis
analyze(Reader input)
Analyze the given character stream as log data.FormatAnalyzer.FormatAnalysis
analyze(String file, CharsetEncoding encoding)
Analyze the specified file expecting the described character set encoding.
-
-
-
Method Detail
-
analyze
public FormatAnalyzer.FormatAnalysis analyze(String file, CharsetEncoding encoding) throws IOException, ParseException
Analyze the specified file expecting the described character set encoding.- Parameters:
file
- the file to analyze. This value will be interpreted usingPaths.asPath(String)
.encoding
- a specification of the character set encoding of the file- Returns:
- the resulting analysis
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed or is otherwise malformed
-
analyze
public FormatAnalyzer.FormatAnalysis analyze(Path file, CharsetEncoding encoding) throws IOException, ParseException
Analyze the specified file expecting the described character set encoding.- Parameters:
file
- the file to analyzeencoding
- a specification of the character set encoding of the file- Returns:
- the resulting analysis
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed or is otherwise malformed
-
analyze
public FormatAnalyzer.FormatAnalysis analyze(Path file, CharsetEncoding encoding, FileClient client) throws IOException, ParseException
Analyze the specified file expecting the described character set encoding.- Parameters:
file
- the file to analyzeencoding
- a specification of the character set encoding of the fileclient
- the authorization context to use for accessing the file- Returns:
- the resulting analysis
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed or is otherwise malformed
-
analyze
public FormatAnalyzer.FormatAnalysis analyze(Reader input) throws IOException, ParseException
Analyze the given character stream as log data.- Parameters:
input
- the data stream to analyze- Returns:
- the resulting analysis of the input
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed or is otherwise malformed
-
-