public class LinkedResource extends AttachmentBase
Represents an embedded resource in a message.
Constructor and Description |
---|
LinkedResource(InputStream contentStream)
Initializes a new instance of the
LinkedResource class. |
LinkedResource(InputStream contentStream,
ContentType contentType)
Initializes a new instance of the
LinkedResource class. |
LinkedResource(InputStream contentStream,
String mediaType)
Initializes a new instance of the
LinkedResource class. |
LinkedResource(String fileName)
Initializes a new instance of the
LinkedResource class. |
LinkedResource(String fileName,
ContentType contentType)
Initializes a new instance of the
LinkedResource class. |
LinkedResource(String fileName,
String mediaType)
Initializes a new instance of the
LinkedResource class. |
Modifier and Type | Method and Description |
---|---|
static LinkedResource |
createLinkedResourceFromString(String content)
Creates the linked resource from string.
|
static LinkedResource |
createLinkedResourceFromString(String content,
Charset contentEncoding,
String mediaType)
Creates the linked resource from string.
|
static LinkedResource |
createLinkedResourceFromString(String content,
ContentType contentType)
Creates the linked resource from string.
|
URI |
getContentLink()
Gets or sets a URI that the resource must match.
|
void |
setContentLink(URI value)
Gets or sets a URI that the resource must match.
|
dispose, dispose, generateContentId, getContentId, getContentStream, getContentType, getEncodingFromContent, getHeaders, getTransferEncoding, save, save, setContentFromString, setContentId, setContentStream, setContentType, setTransferEncoding
public LinkedResource(String fileName)
Initializes a new instance of the LinkedResource
class.
fileName
- The file name that holds the content for this resource.public LinkedResource(String fileName, String mediaType)
Initializes a new instance of the LinkedResource
class.
fileName
- The file name that holds the content for this resource.mediaType
- Internet media type.public LinkedResource(String fileName, ContentType contentType)
Initializes a new instance of the LinkedResource
class.
fileName
- The file name that holds the content for this resource.contentType
- The type of content.public LinkedResource(InputStream contentStream)
Initializes a new instance of the LinkedResource
class.
contentStream
- A stream that contains the content for this resource.public LinkedResource(InputStream contentStream, String mediaType)
Initializes a new instance of the LinkedResource
class.
contentStream
- A stream that contains the content for this resource.mediaType
- Internet media type.public LinkedResource(InputStream contentStream, ContentType contentType)
Initializes a new instance of the LinkedResource
class.
contentStream
- A stream that contains the content for this resource.contentType
- The type of content.public final URI getContentLink()
Gets or sets a URI that the resource must match.
public final void setContentLink(URI value)
Gets or sets a URI that the resource must match.
public static LinkedResource createLinkedResourceFromString(String content)
Creates the linked resource from string.
content
- A string that contains the resource to be included in the email attachment.public static LinkedResource createLinkedResourceFromString(String content, Charset contentEncoding, String mediaType)
Creates the linked resource from string.
content
- A string that contains the resource to be included in the email attachment.contentEncoding
- The content encoding.mediaType
- The MIME media type of the content.public static LinkedResource createLinkedResourceFromString(String content, ContentType contentType)
Creates the linked resource from string.
content
- A string that contains the resource to be included in the email attachment.contentType
- The type of the content.