|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DocumentService
Raw document processing service. Processes a raw File
,
URL
, URI
, or InputStream
and returns
a document handle that acts as a unique identifier.
Provides the ability to automatically detect file types (PDF, MSWord, HTML,
XML, etc) or to specify them manually. Automatic detection refers to the
DocumentService
's ability to identify the file type of the
source and strip out all mark up, turning it into a String
.
Using automatic detection is recommended.
The following is a list of document types which must be provided:
Document
Method Summary | |
---|---|
Document |
process(File file)
Processes the given File , placing the processed contents into
the returned Document . |
Document |
process(File file,
String fileType)
Processes the given File , placing the processed contents into
the returned Document . |
Document |
process(InputStream stream)
Processes the given InputStream , placing the processed
contents into the returned Document . |
Document |
process(InputStream stream,
String fileType)
Processes the given InputStream , placing the processed
contents into the returned Document . |
Document |
process(URI uri)
Processes the given URI , placing the processed contents into
the returned Document . |
Document |
process(URI uri,
String fileType)
Processes the given URI , placing the processed contents into
the returned Document . |
Document |
process(URL url)
Processes the given URL , placing the processed contents into
the returned Document . |
Document |
process(URL url,
String fileType)
Processes the given URL , placing the processed contents into
the returned Document . |
Methods inherited from interface com.languagecomputer.api.Service |
---|
getName, setSession |
Method Detail |
---|
Document process(URL url) throws IOException
URL
, placing the processed contents into
the returned Document
. Automatically detects the file type.
url
- java.net.URL
of the file to process.
Document
corresponding to the given
url.
IOException
- If there was a problem reading the URL
.Document process(URL url, String fileType) throws IOException
URL
, placing the processed contents into
the returned Document
. Forces the document processor to use the
given fileType.
url
- java.net.URL
of the file to process.fileType
- (Advanced Users) Optional file type to force.
Document
corresponding to the given
url.
IllegalArgumentException
- If the given fileType is not
one of the valid file types specified in the DocumentService
.
IOException
- If there was a problem reading the URL
.Document process(URI uri) throws IOException
URI
, placing the processed contents into
the returned Document
. Automatically detects the file type.
uri
- java.net.URI
of the file to process.
Document
corresponding to the given
uri.
IOException
- If there was a problem reading the URI
.Document process(URI uri, String fileType) throws IOException
URI
, placing the processed contents into
the returned Document
. Forces the document processor to use the
given fileType.
uri
- java.net.URI
of the file to process.fileType
- (Advanced Users) Optional file type to force.
Document
corresponding to the given
uri.
IllegalArgumentException
- If the given fileType is not
one of the valid file types specified in the DocumentService
.
IOException
- If there was a problem reading the URI
.Document process(File file) throws IOException
File
, placing the processed contents into
the returned Document
. Automatically detects the file type.
file
- java.io.File
of the file to process.
Document
corresponding to the given
file.
IOException
- If there was a problem reading the File
.Document process(File file, String fileType) throws IOException
File
, placing the processed contents into
the returned Document
. Forces the document processor to use the
given fileType.
file
- java.io.File
of the file to process.fileType
- (Advanced Users) Optional file type to force.
Document
corresponding to the given
file.
IllegalArgumentException
- If the given fileType is not
one of the valid file types specified in the DocumentService
.
IOException
- If there was a problem reading the File
.Document process(InputStream stream) throws IOException
InputStream
, placing the processed
contents into the returned Document
. Automatically detects the
file type.
stream
- java.io.InputStream
of the file to process.
Document
corresponding to the given
stream.
IOException
- If there was a problem reading the
InputStream
.Document process(InputStream stream, String fileType) throws IOException
InputStream
, placing the processed
contents into the returned Document
. Forces the document processor
to use the given fileType.
stream
- java.io.InputStream
of the file to process.fileType
- (Advanced Users) Optional file type to force.
Document
corresponding to the given
stream.
IllegalArgumentException
- If the given fileType is not
one of the valid file types specified in the DocumentService
.
IOException
- If there was a problem reading the
InputStream
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |