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
ExportContextImpl
implements anExportContext
that 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 theOutputContext
but 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 OutputStream
getOutputStream()
Returns a newOutputStream
to the temporary file ornull
if this context provides no stream.void
informCompleted(boolean success)
If success is true, the properties set before an the output stream are written to the wrappedOutputContext
.void
setContentLanguage(String contentLanguage)
Sets the content language.void
setContentLength(long contentLength)
Sets the length of the data.void
setContentType(String mimeType, String encoding)
Set the content type for the resource contentvoid
setCreationTime(long creationTime)
Does nothing since the wrapped output context does not understand creation timevoid
setETag(String etag)
Sets the ETag of the resource.void
setModificationTime(long modificationTime)
Sets the modification time of the resourcevoid
setProperty(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 newOutputStream
to the temporary file ornull
if 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:ExportContext
Sets the content language.- See Also:
ExportContext.setContentLanguage(String)
-
setContentLength
public void setContentLength(long contentLength)
Description copied from interface:ExportContext
Sets 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:ExportContext
Set 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:ExportContext
Sets 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:ExportContext
Sets 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:ExportContext
Sets 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:
informCompleted
in interfaceIOContext
- Overrides:
informCompleted
in classAbstractExportContext
- See Also:
IOContext.informCompleted(boolean)
-
-