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 null
stream
- document input stream, or null
ioListener
- detector
- content type detectorIOException
IOContext.informCompleted(boolean)
public IOListener getIOListener()
IOContext
getIOListener
in interface IOContext
IOContext.getIOListener()
public Item getImportRoot()
ImportContext
getImportRoot
in interface ImportContext
ImportContext.getImportRoot()
public boolean hasStream()
IOContext
hasStream
in interface IOContext
IOContext.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 ImportContext
ImportContext.getInputStream()
,
hasStream()
public String getSystemId()
ImportContext
getSystemId
in interface ImportContext
ImportContext.getSystemId()
public long getModificationTime()
ImportContext
getModificationTime
in interface ImportContext
ImportContext.getModificationTime()
public String getContentLanguage()
ImportContext
null
getContentLanguage
in interface ImportContext
ImportContext.getContentLanguage()
public long getContentLength()
ImportContext
-1
if
the content length could not be determined.getContentLength
in interface ImportContext
ImportContext.getContentLength()
public String getMimeType()
ImportContext
null
should be returned.getMimeType
in interface ImportContext
ImportContext.getMimeType()
public String getEncoding()
ImportContext
null
getEncoding
in interface ImportContext
ImportContext.getEncoding()
public Object getProperty(Object propertyName)
getProperty
in interface ImportContext
ImportContext.getProperty(Object)
public void informCompleted(boolean success)
IOContext
informCompleted
in interface IOContext
IOContext.informCompleted(boolean)
public boolean isCompleted()
IOContext
isCompleted
in interface IOContext
IOContext.isCompleted()
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.