Class PartOnFile

java.lang.Object
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:
  • Method Details

    • getDataHandler

      public DataHandler getDataHandler() throws javax.mail.MessagingException
      Specified by:
      getDataHandler in interface Part
      Returns:
      DataHandler representing this part
      Throws:
      javax.mail.MessagingException
    • getFileName

      public String getFileName() throws javax.mail.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:
      javax.mail.MessagingException
    • getInputStream

      public InputStream getInputStream() throws IOException, javax.mail.MessagingException
      Specified by:
      getInputStream in interface Part
      Returns:
      Get the part data as an input stream
      Throws:
      IOException
      javax.mail.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
      Parameters:
      name -
      value -
    • getAllHeaders

      public Enumeration getAllHeaders() throws javax.mail.MessagingException
      Specified by:
      getAllHeaders in interface Part
      Returns:
      Enumeration of javax.mail.Header
      Throws:
      javax.mail.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
      Parameters:
      name -
      Returns:
      value or null
    • getContentID

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

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

      public String getContentTransferEncoding() throws javax.mail.MessagingException
      Returns:
      contentTransferEncoding
      Throws:
      javax.mail.MessagingException