LinkedResource

Inheritance: java.lang.Object, com.aspose.email.AttachmentBase

public class LinkedResource extends AttachmentBase

Represents an embedded resource in a message.

Constructors

Constructor Description
LinkedResource(String fileName) Initializes a new instance of the LinkedResource class.
LinkedResource(String fileName, String mediaType) Initializes a new instance of the LinkedResource class.
LinkedResource(String fileName, ContentType contentType) Initializes a new instance of the LinkedResource class.
LinkedResource(InputStream contentStream) Initializes a new instance of the LinkedResource class.
LinkedResource(InputStream contentStream, String mediaType) Initializes a new instance of the LinkedResource class.
LinkedResource(InputStream contentStream, ContentType contentType) Initializes a new instance of the LinkedResource class.

Methods

Method Description
getContentLink() Gets or sets a URI that the resource must match.
setContentLink(URI value) Gets or sets a URI that the resource must match.
getContentDisposition() Gets Content-Disposition header
createLinkedResourceFromString(String content) Creates the linked resource from string.
createLinkedResourceFromString(String content, Charset contentEncoding, String mediaType) Creates the linked resource from string.
createLinkedResourceFromString(String content, ContentType contentType) Creates the linked resource from string.

LinkedResource(String fileName)

public LinkedResource(String fileName)

Initializes a new instance of the LinkedResource class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name that holds the content for this resource.

LinkedResource(String fileName, String mediaType)

public LinkedResource(String fileName, String mediaType)

Initializes a new instance of the LinkedResource class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name that holds the content for this resource.
mediaType java.lang.String Internet media type.

LinkedResource(String fileName, ContentType contentType)

public LinkedResource(String fileName, ContentType contentType)

Initializes a new instance of the LinkedResource class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name that holds the content for this resource.
contentType ContentType The type of content.

LinkedResource(InputStream contentStream)

public LinkedResource(InputStream contentStream)

Initializes a new instance of the LinkedResource class.

Parameters:

Parameter Type Description
contentStream java.io.InputStream A stream that contains the content for this resource.

LinkedResource(InputStream contentStream, String mediaType)

public LinkedResource(InputStream contentStream, String mediaType)

Initializes a new instance of the LinkedResource class.

Parameters:

Parameter Type Description
contentStream java.io.InputStream A stream that contains the content for this resource.
mediaType java.lang.String Internet media type.

LinkedResource(InputStream contentStream, ContentType contentType)

public LinkedResource(InputStream contentStream, ContentType contentType)

Initializes a new instance of the LinkedResource class.

Parameters:

Parameter Type Description
contentStream java.io.InputStream A stream that contains the content for this resource.
contentType ContentType The type of content.
public final URI getContentLink()

Gets or sets a URI that the resource must match.

Returns: java.net.URI

public final void setContentLink(URI value)

Gets or sets a URI that the resource must match.

Parameters:

Parameter Type Description
value java.net.URI

getContentDisposition()

public final ContentDisposition getContentDisposition()

Gets Content-Disposition header

Returns: ContentDisposition

createLinkedResourceFromString(String content)

public static LinkedResource createLinkedResourceFromString(String content)

Creates the linked resource from string.

Parameters:

Parameter Type Description
content java.lang.String A string that contains the resource to be included in the email attachment.

Returns: LinkedResource - A LinkedResource object that contains the embedded resource.

createLinkedResourceFromString(String content, Charset contentEncoding, String mediaType)

public static LinkedResource createLinkedResourceFromString(String content, Charset contentEncoding, String mediaType)

Creates the linked resource from string.

Parameters:

Parameter Type Description
content java.lang.String A string that contains the resource to be included in the email attachment.
contentEncoding java.nio.charset.Charset The content encoding.
mediaType java.lang.String The MIME media type of the content.

Returns: LinkedResource - A LinkedResource object that contains the embedded resource.

createLinkedResourceFromString(String content, ContentType contentType)

public static LinkedResource createLinkedResourceFromString(String content, ContentType contentType)

Creates the linked resource from string.

Parameters:

Parameter Type Description
content java.lang.String A string that contains the resource to be included in the email attachment.
contentType ContentType The type of the content.

Returns: LinkedResource - A LinkedResource object that contains the embedded resource.