public class ExportContextImpl extends AbstractExportContext
ExportContextImpl
implements an ExportContext
that
wraps around the specified OutputContext as it was passed to
DavResource.spool(OutputContext)
. If a stream is provided a temporary
file is created, which is deleted as soon as informCompleted(boolean)
is called on this context. Note however, that the properties and the stream
are written to the OutputContext
but upon successful completion.informCompleted(boolean)
completed
Constructor and Description |
---|
ExportContextImpl(Item exportRoot,
OutputContext outputCtx) |
Modifier and Type | Method and Description |
---|---|
OutputStream |
getOutputStream()
Returns a new
OutputStream to the temporary file or
null 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 wrapped
OutputContext . |
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 content
|
void |
setCreationTime(long creationTime)
Does nothing since the wrapped output context does not understand
creation time
|
void |
setETag(String etag)
Sets the ETag of the resource.
|
void |
setModificationTime(long modificationTime)
Sets the modification time of the resource
|
void |
setProperty(Object propertyName,
Object propertyValue)
Sets an arbitrary property to this export context.
|
checkCompleted, getExportRoot, getIOListener, hasStream, isCompleted
public ExportContextImpl(Item exportRoot, OutputContext outputCtx) throws IOException
IOException
public OutputStream getOutputStream()
OutputStream
to the temporary file or
null
if this context provides no stream.null
ExportContext.getOutputStream()
,
informCompleted(boolean)
public void setContentLanguage(String contentLanguage)
ExportContext
ExportContext.setContentLanguage(String)
public void setContentLength(long contentLength)
ExportContext
contentLength
- the content lengthExportContext.setContentLength(long)
public void setContentType(String mimeType, String encoding)
ExportContext
public void setCreationTime(long creationTime)
creationTime
- the creation timeExportContext.setCreationTime(long)
public void setModificationTime(long modificationTime)
ExportContext
modificationTime
- the modification timeExportContext.setModificationTime(long)
public void setETag(String etag)
ExportContext
etag
- the ETagExportContext.setETag(String)
public void setProperty(Object propertyName, Object propertyValue)
ExportContext
public void informCompleted(boolean success)
OutputContext
.informCompleted
in interface IOContext
informCompleted
in class AbstractExportContext
IOContext.informCompleted(boolean)
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.