@ApiStatus.Experimental
public final class Attachment
extends java.lang.Object
Constructor and Description |
---|
Attachment(@NotNull byte[] bytes,
@NotNull java.lang.String filename)
Initializes an Attachment with bytes and a filename.
|
Attachment(@NotNull byte[] bytes,
@NotNull java.lang.String filename,
@NotNull java.lang.String contentType)
Initializes an Attachment with bytes, a filename, and a content type.
|
Attachment(@NotNull byte[] bytes,
@NotNull java.lang.String filename,
@NotNull java.lang.String contentType,
boolean addToTransactions)
Initializes an Attachment with bytes, a filename, a content type, and addToTransactions.
|
Attachment(@NotNull java.lang.String pathname)
Initializes an Attachment with a path.
|
Attachment(@NotNull java.lang.String pathname,
@NotNull java.lang.String filename)
Initializes an Attachment with a path and a filename.
|
Attachment(@NotNull java.lang.String pathname,
@NotNull java.lang.String filename,
@NotNull java.lang.String contentType)
Initializes an Attachment with a path, a filename, and a content type.
|
Attachment(@NotNull java.lang.String pathname,
@NotNull java.lang.String filename,
@NotNull java.lang.String contentType,
boolean addToTransactions)
Initializes an Attachment with a path, a filename, a content type, and addToTransactions.
|
Modifier and Type | Method and Description |
---|---|
@Nullable byte[] |
getBytes()
Gets the bytes of the attachment.
|
@NotNull java.lang.String |
getContentType()
Gets the content type of the attachment.
|
@NotNull java.lang.String |
getFilename()
Gets the name of the attachment to display in Sentry.
|
@Nullable java.lang.String |
getPathname()
Gets the pathname string of the attachment.
|
public Attachment(@NotNull @NotNull byte[] bytes, @NotNull @NotNull java.lang.String filename)
false
.bytes
- The bytes of file.filename
- The name of the attachment to display in Sentry.public Attachment(@NotNull @NotNull byte[] bytes, @NotNull @NotNull java.lang.String filename, @NotNull @NotNull java.lang.String contentType)
false
.bytes
- The bytes of file.filename
- The name of the attachment to display in Sentry.contentType
- The content type of the attachment.public Attachment(@NotNull @NotNull byte[] bytes, @NotNull @NotNull java.lang.String filename, @NotNull @NotNull java.lang.String contentType, boolean addToTransactions)
bytes
- The bytes of file.filename
- The name of the attachment to display in Sentry.contentType
- The content type of the attachment.addToTransactions
- true
if the SDK should add this attachment to every
ITransaction
or set to false
if it shouldn't.public Attachment(@NotNull @NotNull java.lang.String pathname)
false
.
The file located at the pathname is read lazily when the SDK captures an event or transaction not when the attachment is initialized. The pathname string is converted into an abstract pathname before reading the file.
pathname
- The pathname string of the file to upload as an attachment.public Attachment(@NotNull @NotNull java.lang.String pathname, @NotNull @NotNull java.lang.String filename)
false
.
The file located at the pathname is read lazily when the SDK captures an event or transaction not when the attachment is initialized. The pathname string is converted into an abstract pathname before reading the file.
pathname
- The pathname string of the file to upload as an attachment.filename
- The name of the attachment to display in Sentry.public Attachment(@NotNull @NotNull java.lang.String pathname, @NotNull @NotNull java.lang.String filename, @NotNull @NotNull java.lang.String contentType)
false
.
The file located at the pathname is read lazily when the SDK captures an event or transaction not when the attachment is initialized. The pathname string is converted into an abstract pathname before reading the file.
pathname
- The pathname string of the file to upload as an attachment.filename
- The name of the attachment to display in Sentry.contentType
- The content type of the attachment.public Attachment(@NotNull @NotNull java.lang.String pathname, @NotNull @NotNull java.lang.String filename, @NotNull @NotNull java.lang.String contentType, boolean addToTransactions)
The file located at the pathname is read lazily when the SDK captures an event or transaction not when the attachment is initialized. The pathname string is converted into an abstract pathname before reading the file.
pathname
- The pathname string of the file to upload as an attachment.filename
- The name of the attachment to display in Sentry.contentType
- The content type of the attachment.addToTransactions
- true
if the SDK should add this attachment to every
ITransaction
or set to false
if it shouldn't.@Nullable public @Nullable byte[] getBytes()
@Nullable public @Nullable java.lang.String getPathname()
@NotNull public @NotNull java.lang.String getFilename()
@NotNull public @NotNull java.lang.String getContentType()