Package org.apache.axiom.attachments
Interface Part
-
- All Known Implementing Classes:
PartOnFile,PartOnMemory,PartOnMemoryEnhanced
public interface PartAbstract for Part. A Part can be the SOAP Part or an Attachment Part. There are several implementations for part, which are optimized for space and time. A Part is created with the PartFactory.- See Also:
PartFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddHeader(String name, String value)Add a Header (name, value) to the partEnumerationgetAllHeaders()StringgetContentID()StringgetContentType()DataHandlergetDataHandler()StringgetFileName()Deprecated.The callers should not no how the part is implemented.StringgetHeader(String name)Get the value of a specific headerInputStreamgetInputStream()longgetSize()
-
-
-
Method Detail
-
getDataHandler
DataHandler getDataHandler() throws javax.mail.MessagingException
- Returns:
- DataHandler representing this part
- Throws:
javax.mail.MessagingException
-
getSize
long getSize() throws javax.mail.MessagingException- Returns:
- size
- Throws:
javax.mail.MessagingException
-
getContentType
String getContentType() throws javax.mail.MessagingException
- Returns:
- content type of the part
- Throws:
javax.mail.MessagingException
-
getContentID
String getContentID() throws javax.mail.MessagingException
- Returns:
- content id of the part
- Throws:
javax.mail.MessagingException
-
getFileName
String getFileName() throws javax.mail.MessagingException
Deprecated.The callers should not no how the part is implemented.The part may be backed by a file. If that is the case, this method returns the file name.- Returns:
- the name of the file
- Throws:
javax.mail.MessagingException
-
getInputStream
InputStream getInputStream() throws IOException, javax.mail.MessagingException
- Returns:
- Get the part data as an input stream
- Throws:
IOExceptionjavax.mail.MessagingException
-
addHeader
void addHeader(String name, String value) throws javax.mail.MessagingException
Add a Header (name, value) to the part- Parameters:
name-value-- Throws:
javax.mail.MessagingException
-
getHeader
String getHeader(String name) throws javax.mail.MessagingException
Get the value of a specific header- Parameters:
name-- Returns:
- value or null
- Throws:
javax.mail.MessagingException
-
getAllHeaders
Enumeration getAllHeaders() throws javax.mail.MessagingException
- Returns:
- Enumeration of javax.mail.Header
- Throws:
javax.mail.MessagingException
-
-