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 StringgetContentLanguage()longgetContentLength()StringgetEncoding()javax.jcr.ItemgetImportRoot()InputStreamgetInputStream()Returns a newInputStreamto the temporary file created during instanciation ornull, if this context does not provide a stream.org.apache.jackrabbit.server.io.IOListenergetIOListener()StringgetMimeType()longgetModificationTime()ObjectgetProperty(Object propertyName)StringgetSystemId()booleanhasStream()voidinformCompleted(boolean success)booleanisCompleted()
-
-
-
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 IOExceptionCreates 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, ornullstream- document input stream, ornullioListener-detector- content type detector- Throws:
IOException- See Also:
IOContext.informCompleted(boolean)
-
-
Method Detail
-
getIOListener
public org.apache.jackrabbit.server.io.IOListener getIOListener()
- Specified by:
getIOListenerin interfaceorg.apache.jackrabbit.server.io.IOContext- See Also:
IOContext.getIOListener()
-
getImportRoot
public javax.jcr.Item getImportRoot()
- Specified by:
getImportRootin interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getImportRoot()
-
hasStream
public boolean hasStream()
- Specified by:
hasStreamin interfaceorg.apache.jackrabbit.server.io.IOContext- See Also:
IOContext.hasStream()
-
getInputStream
public InputStream getInputStream()
Returns a newInputStreamto the temporary file created during instanciation ornull, if this context does not provide a stream.- Specified by:
getInputStreamin interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getInputStream(),hasStream()
-
getSystemId
public String getSystemId()
- Specified by:
getSystemIdin interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getSystemId()
-
getModificationTime
public long getModificationTime()
- Specified by:
getModificationTimein interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getModificationTime()
-
getContentLanguage
public String getContentLanguage()
- Specified by:
getContentLanguagein interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getContentLanguage()
-
getContentLength
public long getContentLength()
- Specified by:
getContentLengthin interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getContentLength()
-
getMimeType
public String getMimeType()
- Specified by:
getMimeTypein interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getMimeType()
-
getEncoding
public String getEncoding()
- Specified by:
getEncodingin interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getEncoding()
-
getProperty
public Object getProperty(Object propertyName)
- Specified by:
getPropertyin interfaceorg.apache.jackrabbit.server.io.ImportContext- See Also:
ImportContext.getProperty(Object)
-
informCompleted
public void informCompleted(boolean success)
- Specified by:
informCompletedin interfaceorg.apache.jackrabbit.server.io.IOContext- See Also:
IOContext.informCompleted(boolean)
-
isCompleted
public boolean isCompleted()
- Specified by:
isCompletedin interfaceorg.apache.jackrabbit.server.io.IOContext- See Also:
IOContext.isCompleted()
-
-