public class AttachmentDataSource
extends java.lang.Object
implements javax.activation.DataSource
DataSource
associado a um nome de arquivo e que pode
receber e fornecer bytes de dados para ser usado como anexo de e-mails.
Seu propósito principal é dispensar o uso de arquivos temporários gravados em
disco para anexar a e-mails.Constructor and Description |
---|
AttachmentDataSource(java.lang.String fileName)
Inicializa um anexo com um nome de arquivo.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Retorna o tipo de conteúdo conforme está mapeado em
javax.activation.MimetypesFileTypeMap . |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
public AttachmentDataSource(java.lang.String fileName)
fileName
- o nome do arquivo a anexarpublic java.io.InputStream getInputStream()
getInputStream
in interface javax.activation.DataSource
public java.io.OutputStream getOutputStream()
getOutputStream
in interface javax.activation.DataSource
public java.lang.String getContentType()
javax.activation.MimetypesFileTypeMap
.getContentType
in interface javax.activation.DataSource
public java.lang.String getName()
getName
in interface javax.activation.DataSource