Package org.springframework.ws.mime
Interface Attachment
public interface Attachment
Represents an attachment to a
MimeMessage- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the content identifier of the attachment.Returns the content type of the attachment.jakarta.activation.DataHandlerReturns the data handler of the attachment.Return anInputStreamto read the contents of the attachment from.longgetSize()Returns the size of the attachment in bytes.
-
Method Details
-
getContentId
String getContentId()Returns the content identifier of the attachment.- Returns:
- the content id, or
nullif empty or not defined
-
getContentType
String getContentType()Returns the content type of the attachment.- Returns:
- the content type, or
nullif empty or not defined
-
getInputStream
Return anInputStreamto read the contents of the attachment from. The user is responsible for closing the stream.- Returns:
- the contents of the file as stream, or an empty stream if empty
- Throws:
IOException- in case of access I/O errors
-
getSize
long getSize()Returns the size of the attachment in bytes. Returns-1if the size cannot be determined.- Returns:
- the size of the attachment,
0if empty, or-1if the size cannot be determined
-
getDataHandler
jakarta.activation.DataHandler getDataHandler()Returns the data handler of the attachment.- Returns:
- the data handler of the attachment
-