public class ImportContextImpl extends Object implements ImportContext
ImportContextImpl...| Constructor and Description |
|---|
ImportContextImpl(Item importRoot,
String systemId,
InputContext inputCtx,
InputStream stream,
IOListener ioListener,
org.apache.tika.detect.Detector detector)
Creates a new item import context.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getContentLanguage()
Returns the content language or
null |
long |
getContentLength()
Returns the length of the data or
-1 if
the content length could not be determined. |
String |
getEncoding()
Returns the encoding extracted from a content type as present in a
request header or
null |
Item |
getImportRoot()
Returns the import root of the resource to import, i.e.
|
InputStream |
getInputStream()
Returns a new
InputStream to the temporary file created
during instantiation or null, if this context does not
provide a stream. |
IOListener |
getIOListener()
Returns the IOListener.
|
String |
getMimeType()
Returns the main media type.
|
long |
getModificationTime()
Returns the modification time of the resource or the current time if
the modification time has not been set.
|
Object |
getProperty(Object propertyName) |
String |
getSystemId()
Returns the system id of the resource to be imported.
|
boolean |
hasStream()
Return true if the given export context can provide an output stream
|
void |
informCompleted(boolean success)
Informs this context that it will not be used for further exports any
more.
|
boolean |
isCompleted()
Returns true if this context already has been completed.
|
public ImportContextImpl(Item importRoot, String systemId, InputContext inputCtx, InputStream stream, IOListener ioListener, org.apache.tika.detect.Detector detector) throws IOException
importRoot - systemId - inputCtx - input context, or nullstream - document input stream, or nullioListener - detector - content type detectorIOExceptionIOContext.informCompleted(boolean)public IOListener getIOListener()
IOContextgetIOListener in interface IOContextIOContext.getIOListener()public Item getImportRoot()
ImportContextgetImportRoot in interface ImportContextImportContext.getImportRoot()public boolean hasStream()
IOContexthasStream in interface IOContextIOContext.hasStream()public InputStream getInputStream()
InputStream to the temporary file created
during instantiation or null, if this context does not
provide a stream.getInputStream in interface ImportContextImportContext.getInputStream(),
hasStream()public String getSystemId()
ImportContextgetSystemId in interface ImportContextImportContext.getSystemId()public long getModificationTime()
ImportContextgetModificationTime in interface ImportContextImportContext.getModificationTime()public String getContentLanguage()
ImportContextnullgetContentLanguage in interface ImportContextImportContext.getContentLanguage()public long getContentLength()
ImportContext-1 if
the content length could not be determined.getContentLength in interface ImportContextImportContext.getContentLength()public String getMimeType()
ImportContextnull should be returned.getMimeType in interface ImportContextImportContext.getMimeType()public String getEncoding()
ImportContextnullgetEncoding in interface ImportContextImportContext.getEncoding()public Object getProperty(Object propertyName)
getProperty in interface ImportContextImportContext.getProperty(Object)public void informCompleted(boolean success)
IOContextinformCompleted in interface IOContextIOContext.informCompleted(boolean)public boolean isCompleted()
IOContextisCompleted in interface IOContextIOContext.isCompleted()Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.