org.codehaus.xfire.attachments
Class StreamedAttachments

java.lang.Object
  extended by org.codehaus.xfire.attachments.StreamedAttachments
All Implemented Interfaces:
Attachments

public class StreamedAttachments
extends java.lang.Object
implements Attachments


Field Summary
static java.lang.String ATTACHMENT_DIRECTORY
           
static java.lang.String ATTACHMENT_MEMORY_THRESHOLD
           
 
Constructor Summary
StreamedAttachments(java.io.InputStream is, java.lang.String contentType)
           
StreamedAttachments(MessageContext context, java.io.InputStream is, java.lang.String contentType)
           
 
Method Summary
 void addPart(Attachment part)
           
protected static void copy(java.io.InputStream input, java.io.OutputStream output)
           
 void dispose()
           
 java.lang.String getContentType()
          Get the conetnt type of the whole message.
 Attachment getPart(java.lang.String id)
           
 java.util.Iterator getParts()
           
 java.lang.String getSoapContentType()
          Get the content type of the soap message.
 Attachment getSoapMessage()
           
 java.io.File getTempDirectory()
          The directory where attachments will be written to if they exceed the Threshold.
 int getThreshold()
          Get the threshold in bytes.
 void setSoapContentType(java.lang.String soapMimeType)
          Set the content type of the soap message.
 void setSoapMessage(Attachment soapMessage)
           
 void setTempDirectory(java.io.File tempDirectory)
           
 void setThreshold(int threshold)
           
 int size()
           
 void write(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTACHMENT_DIRECTORY

public static final java.lang.String ATTACHMENT_DIRECTORY
See Also:
Constant Field Values

ATTACHMENT_MEMORY_THRESHOLD

public static final java.lang.String ATTACHMENT_MEMORY_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

StreamedAttachments

public StreamedAttachments(java.io.InputStream is,
                           java.lang.String contentType)
                    throws java.io.IOException
Throws:
java.io.IOException

StreamedAttachments

public StreamedAttachments(MessageContext context,
                           java.io.InputStream is,
                           java.lang.String contentType)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

addPart

public void addPart(Attachment part)
Specified by:
addPart in interface Attachments

getContentType

public java.lang.String getContentType()
Description copied from interface: Attachments
Get the conetnt type of the whole message.

Specified by:
getContentType in interface Attachments
Returns:

getPart

public Attachment getPart(java.lang.String id)
Specified by:
getPart in interface Attachments

getParts

public java.util.Iterator getParts()
Specified by:
getParts in interface Attachments

getSoapContentType

public java.lang.String getSoapContentType()
Description copied from interface: Attachments
Get the content type of the soap message.

Specified by:
getSoapContentType in interface Attachments
Returns:

getSoapMessage

public Attachment getSoapMessage()
Specified by:
getSoapMessage in interface Attachments
Returns:
Returns the SOAP Message.

setSoapContentType

public void setSoapContentType(java.lang.String soapMimeType)
Description copied from interface: Attachments
Set the content type of the soap message.

Specified by:
setSoapContentType in interface Attachments

setSoapMessage

public void setSoapMessage(Attachment soapMessage)
Specified by:
setSoapMessage in interface Attachments
Parameters:
soapMessage - The SOAP Message to set.

size

public int size()
Specified by:
size in interface Attachments

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
Specified by:
write in interface Attachments
Throws:
java.io.IOException

dispose

public void dispose()

getTempDirectory

public java.io.File getTempDirectory()
The directory where attachments will be written to if they exceed the Threshold.

Returns:

setTempDirectory

public void setTempDirectory(java.io.File tempDirectory)

getThreshold

public int getThreshold()
Get the threshold in bytes. The threshold is the size an attachment needs to reach before it is written to a temporary directory.

Returns:

setThreshold

public void setThreshold(int threshold)

copy

protected static void copy(java.io.InputStream input,
                           java.io.OutputStream output)
                    throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2004-2009. All Rights Reserved.