Package org.apache.tika.example
Class ImportContextImpl
- java.lang.Object
-
- org.apache.tika.example.ImportContextImpl
-
- All Implemented Interfaces:
org.apache.jackrabbit.server.io.ImportContext
,org.apache.jackrabbit.server.io.IOContext
public class ImportContextImpl extends Object implements org.apache.jackrabbit.server.io.ImportContext
ImportContextImpl
...
-
-
Constructor Summary
Constructors Constructor Description ImportContextImpl(javax.jcr.Item importRoot, String systemId, org.apache.jackrabbit.webdav.io.InputContext ctx, InputStream stream, org.apache.jackrabbit.server.io.IOListener ioListener, Detector detector)
Creates a new item import context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContentLanguage()
long
getContentLength()
String
getEncoding()
javax.jcr.Item
getImportRoot()
InputStream
getInputStream()
Returns a newInputStream
to the temporary file created during instanciation ornull
, if this context does not provide a stream.org.apache.jackrabbit.server.io.IOListener
getIOListener()
String
getMimeType()
long
getModificationTime()
Object
getProperty(Object propertyName)
String
getSystemId()
boolean
hasStream()
void
informCompleted(boolean success)
boolean
isCompleted()
-
-
-
Constructor Detail
-
ImportContextImpl
public ImportContextImpl(javax.jcr.Item importRoot, String systemId, org.apache.jackrabbit.webdav.io.InputContext ctx, InputStream stream, org.apache.jackrabbit.server.io.IOListener ioListener, Detector detector) throws IOException
Creates a new item import context. The specified InputStream is written to a temporary file in order to avoid problems with multiple IOHandlers that try to run the import but fail. The temporary file is deleted as soon as this context is informed that the import has been completed and it will not be used any more.- Parameters:
importRoot
-systemId
-ctx
- input context, ornull
stream
- document input stream, ornull
ioListener
-detector
- content type detector- Throws:
IOException
- See Also:
IOContext.informCompleted(boolean)
-
-
Method Detail
-
getIOListener
public org.apache.jackrabbit.server.io.IOListener getIOListener()
- Specified by:
getIOListener
in interfaceorg.apache.jackrabbit.server.io.IOContext
- See Also:
IOContext.getIOListener()
-
getImportRoot
public javax.jcr.Item getImportRoot()
- Specified by:
getImportRoot
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getImportRoot()
-
hasStream
public boolean hasStream()
- Specified by:
hasStream
in interfaceorg.apache.jackrabbit.server.io.IOContext
- See Also:
IOContext.hasStream()
-
getInputStream
public InputStream getInputStream()
Returns a newInputStream
to the temporary file created during instanciation ornull
, if this context does not provide a stream.- Specified by:
getInputStream
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getInputStream()
,hasStream()
-
getSystemId
public String getSystemId()
- Specified by:
getSystemId
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getSystemId()
-
getModificationTime
public long getModificationTime()
- Specified by:
getModificationTime
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getModificationTime()
-
getContentLanguage
public String getContentLanguage()
- Specified by:
getContentLanguage
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getContentLanguage()
-
getContentLength
public long getContentLength()
- Specified by:
getContentLength
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getContentLength()
-
getMimeType
public String getMimeType()
- Specified by:
getMimeType
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getMimeType()
-
getEncoding
public String getEncoding()
- Specified by:
getEncoding
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getEncoding()
-
getProperty
public Object getProperty(Object propertyName)
- Specified by:
getProperty
in interfaceorg.apache.jackrabbit.server.io.ImportContext
- See Also:
ImportContext.getProperty(Object)
-
informCompleted
public void informCompleted(boolean success)
- Specified by:
informCompleted
in interfaceorg.apache.jackrabbit.server.io.IOContext
- See Also:
IOContext.informCompleted(boolean)
-
isCompleted
public boolean isCompleted()
- Specified by:
isCompleted
in interfaceorg.apache.jackrabbit.server.io.IOContext
- See Also:
IOContext.isCompleted()
-
-