Package org.apache.beam.sdk.io.tika
Class ParseResult
java.lang.Object
org.apache.beam.sdk.io.tika.ParseResult
- All Implemented Interfaces:
Serializable
The result of parsing a single file with Tika: contains the file's location, metadata, extracted
text, and optionally an error. If there is an error, the metadata and extracted text may be
partial (i.e. not represent the entire file).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static ParseResult
failure
(String fileLocation, String partialContent, org.apache.tika.metadata.Metadata partialMetadata, Throwable error) Returns the extracted text.getError()
Returns the parse error, if the file was parsed unsuccessfully.Same asgetError()
, but returns the complete stack trace of the error as aString
.Returns the absolute path to the input file.org.apache.tika.metadata.Metadata
Returns the extracted metadata.int
hashCode()
boolean
Returns whether this file was parsed successfully.static ParseResult
static ParseResult
toString()
-
Method Details
-
success
public static ParseResult success(String fileLocation, String content, org.apache.tika.metadata.Metadata metadata) -
success
-
failure
public static ParseResult failure(String fileLocation, String partialContent, org.apache.tika.metadata.Metadata partialMetadata, Throwable error) -
getFileLocation
Returns the absolute path to the input file. -
isSuccess
public boolean isSuccess()Returns whether this file was parsed successfully. -
getError
Returns the parse error, if the file was parsed unsuccessfully. -
getErrorAsString
Same asgetError()
, but returns the complete stack trace of the error as aString
. -
getContent
Returns the extracted text. May be partial, if this parse result contains a failure. -
getMetadata
public org.apache.tika.metadata.Metadata getMetadata()Returns the extracted metadata. May be partial, if this parse result contains a failure. -
hashCode
public int hashCode() -
equals
-
toString
-