Package org.apache.jackrabbit.server.io
Class ExportContextImpl
- java.lang.Object
-
- org.apache.jackrabbit.server.io.AbstractExportContext
-
- org.apache.jackrabbit.server.io.ExportContextImpl
-
- All Implemented Interfaces:
ExportContext,IOContext
public class ExportContextImpl extends AbstractExportContext
ExportContextImplimplements anExportContextthat wraps around the specified OutputContext as it was passed toDavResource.spool(OutputContext). If a stream is provided a temporary file is created, which is deleted as soon asinformCompleted(boolean)is called on this context. Note however, that the properties and the stream are written to theOutputContextbut upon successful completion.- See Also:
informCompleted(boolean)
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.server.io.AbstractExportContext
completed
-
-
Constructor Summary
Constructors Constructor Description ExportContextImpl(Item exportRoot, OutputContext outputCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStreamgetOutputStream()Returns a newOutputStreamto the temporary file ornullif this context provides no stream.voidinformCompleted(boolean success)If success is true, the properties set before an the output stream are written to the wrappedOutputContext.voidsetContentLanguage(String contentLanguage)Sets the content language.voidsetContentLength(long contentLength)Sets the length of the data.voidsetContentType(String mimeType, String encoding)Set the content type for the resource contentvoidsetCreationTime(long creationTime)Does nothing since the wrapped output context does not understand creation timevoidsetETag(String etag)Sets the ETag of the resource.voidsetModificationTime(long modificationTime)Sets the modification time of the resourcevoidsetProperty(Object propertyName, Object propertyValue)Sets an arbitrary property to this export context.-
Methods inherited from class org.apache.jackrabbit.server.io.AbstractExportContext
checkCompleted, getExportRoot, getIOListener, hasStream, isCompleted
-
-
-
-
Constructor Detail
-
ExportContextImpl
public ExportContextImpl(Item exportRoot, OutputContext outputCtx) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getOutputStream
public OutputStream getOutputStream()
Returns a newOutputStreamto the temporary file ornullif this context provides no stream.- Returns:
- output stream or
null - See Also:
ExportContext.getOutputStream(),informCompleted(boolean)
-
setContentLanguage
public void setContentLanguage(String contentLanguage)
Description copied from interface:ExportContextSets the content language.- See Also:
ExportContext.setContentLanguage(String)
-
setContentLength
public void setContentLength(long contentLength)
Description copied from interface:ExportContextSets the length of the data.- Parameters:
contentLength- the content length- See Also:
ExportContext.setContentLength(long)
-
setContentType
public void setContentType(String mimeType, String encoding)
Description copied from interface:ExportContextSet the content type for the resource content
-
setCreationTime
public void setCreationTime(long creationTime)
Does nothing since the wrapped output context does not understand creation time- Parameters:
creationTime- the creation time- See Also:
ExportContext.setCreationTime(long)
-
setModificationTime
public void setModificationTime(long modificationTime)
Description copied from interface:ExportContextSets the modification time of the resource- Parameters:
modificationTime- the modification time- See Also:
ExportContext.setModificationTime(long)
-
setETag
public void setETag(String etag)
Description copied from interface:ExportContextSets the ETag of the resource. A successful export command may set this member.- Parameters:
etag- the ETag- See Also:
ExportContext.setETag(String)
-
setProperty
public void setProperty(Object propertyName, Object propertyValue)
Description copied from interface:ExportContextSets an arbitrary property to this export context.
-
informCompleted
public void informCompleted(boolean success)
If success is true, the properties set before an the output stream are written to the wrappedOutputContext.- Specified by:
informCompletedin interfaceIOContext- Overrides:
informCompletedin classAbstractExportContext- See Also:
IOContext.informCompleted(boolean)
-
-