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, isCompletedpublic ExportContextImpl(Item exportRoot, OutputContext outputCtx) throws IOException
IOExceptionpublic OutputStream getOutputStream()
OutputStream to the temporary file or
null if this context provides no stream.nullExportContext.getOutputStream(),
informCompleted(boolean)public void setContentLanguage(String contentLanguage)
ExportContextExportContext.setContentLanguage(String)public void setContentLength(long contentLength)
ExportContextcontentLength - the content lengthExportContext.setContentLength(long)public void setContentType(String mimeType, String encoding)
ExportContextpublic void setCreationTime(long creationTime)
creationTime - the creation timeExportContext.setCreationTime(long)public void setModificationTime(long modificationTime)
ExportContextmodificationTime - the modification timeExportContext.setModificationTime(long)public void setETag(String etag)
ExportContextetag - the ETagExportContext.setETag(String)public void setProperty(Object propertyName, Object propertyValue)
ExportContextpublic void informCompleted(boolean success)
OutputContext.informCompleted in interface IOContextinformCompleted in class AbstractExportContextIOContext.informCompleted(boolean)Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.