org.apache.axiom.attachments.impl
Class PartOnFile

java.lang.Object
  extended by org.apache.axiom.attachments.impl.PartOnFile
All Implemented Interfaces:
Part

public class PartOnFile
extends Object

PartOnFile stores that attachment in a file. This implementation is used for very large attachments to reduce the in-memory footprint. The PartOnFile object is created by the PartFactory

See Also:
PartFactory

Method Summary
 void addHeader(String name, String value)
          Add a Header (name, value) to the part
 Enumeration getAllHeaders()
           
 String getContentID()
           
 String getContentTransferEncoding()
           
 String getContentType()
           
 DataHandler getDataHandler()
           
 String getFileName()
          The part may be backed by a file.
 String getHeader(String name)
          Get the value of a specific header
 InputStream getInputStream()
           
 long getSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataHandler

public DataHandler getDataHandler()
                           throws MessagingException
Specified by:
getDataHandler in interface Part
Returns:
DataHandler representing this part
Throws:
MessagingException

getFileName

public String getFileName()
                   throws MessagingException
Description copied from interface: Part
The part may be backed by a file. If that is the case, this method returns the file name.

Specified by:
getFileName in interface Part
Returns:
the name of the file
Throws:
MessagingException

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Specified by:
getInputStream in interface Part
Returns:
Get the part data as an input stream
Throws:
IOException
MessagingException

getSize

public long getSize()
Specified by:
getSize in interface Part
Returns:
size

addHeader

public void addHeader(String name,
                      String value)
Description copied from interface: Part
Add a Header (name, value) to the part

Specified by:
addHeader in interface Part

getAllHeaders

public Enumeration getAllHeaders()
                          throws MessagingException
Specified by:
getAllHeaders in interface Part
Returns:
Enumeration of javax.mail.Header
Throws:
MessagingException

getHeader

public String getHeader(String name)
Description copied from interface: Part
Get the value of a specific header

Specified by:
getHeader in interface Part
Returns:
value or null

getContentID

public String getContentID()
                    throws MessagingException
Specified by:
getContentID in interface Part
Returns:
content id of the part
Throws:
MessagingException

getContentType

public String getContentType()
                      throws MessagingException
Specified by:
getContentType in interface Part
Returns:
content type of the part
Throws:
MessagingException

getContentTransferEncoding

public String getContentTransferEncoding()
                                  throws MessagingException
Returns:
contentTransferEncoding
Throws:
MessagingException


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