org.apache.jackrabbit.server.io
Class ExportContextImpl

java.lang.Object
  extended by org.apache.jackrabbit.server.io.AbstractExportContext
      extended by org.apache.jackrabbit.server.io.ExportContextImpl
All Implemented Interfaces:
ExportContext, IOContext

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.

See Also:
informCompleted(boolean)

Field Summary
 
Fields inherited from class org.apache.jackrabbit.server.io.AbstractExportContext
completed
 
Constructor Summary
ExportContextImpl(Item exportRoot, OutputContext outputCtx)
           
 
Method Summary
 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.
 
Methods inherited from class org.apache.jackrabbit.server.io.AbstractExportContext
checkCompleted, getExportRoot, getIOListener, hasStream, isCompleted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExportContextImpl

public ExportContextImpl(Item exportRoot,
                         OutputContext outputCtx)
                  throws IOException
Throws:
IOException
Method Detail

getOutputStream

public OutputStream getOutputStream()
Returns a new OutputStream to the temporary file or null 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

See Also:
ExportContext.setContentType(String,String)

setCreationTime

public void setCreationTime(long creationTime)
Does nothing since the wrapped output context does not understand creation time

Parameters:
creationTime -
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 successfull 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.

See Also:
ExportContext.setProperty(Object, Object)

informCompleted

public void informCompleted(boolean success)
If success is true, the properties set before an the output stream are written to the wrapped OutputContext.

Specified by:
informCompleted in interface IOContext
Overrides:
informCompleted in class AbstractExportContext
Parameters:
success -
See Also:
IOContext.informCompleted(boolean)


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.