public class Attachment
extends java.lang.Object
Constructor and Description |
---|
Attachment()
Default constructor
|
Attachment(java.lang.String contentID,
java.lang.String contentType,
java.io.InputStream content)
Constructs with an ID, content-type, and content.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeaderValue(java.lang.String name,
java.lang.String value)
Adds a header to the attachment.
|
java.io.InputStream |
getContent()
Returns the content of the attachment.
|
java.lang.String |
getContentID()
Returns the ID of the attachment.
|
java.lang.String |
getContentType()
Returns the content-type of the attachment.
|
java.util.Set |
getHeaderNames()
Returns the names of all headers defined for the attachment.
|
java.lang.String[] |
getHeaderValue(java.lang.String name)
Returns the value(s) of the header with the given name.
|
void |
setContent(java.io.InputStream content)
Changes the content of the attachment.
|
void |
setContentID(java.lang.String contentID)
Changes the ID of the attachment.
|
void |
setContentType(java.lang.String contentType)
Changes the content-type of the attachment.
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Replaces the current header with the same name with the given value.
|
void |
setHeader(java.lang.String name,
java.lang.String[] values)
Replaces the current header with the same name with the given values.
|
public Attachment()
public Attachment(java.lang.String contentID, java.lang.String contentType, java.io.InputStream content)
contentID
- ID of the attachment.contentType
- Content-type of the attachment.content
- InputStream to the content of the attachment.public java.lang.String getContentID()
public void setContentID(java.lang.String contentID)
contentID
- String identifier of the attachment.public java.lang.String getContentType()
public void setContentType(java.lang.String contentType)
contentType
- String content-type of the attachment.public java.io.InputStream getContent()
public void setContent(java.io.InputStream content)
content
- InputStream to the content of the attachment.public void addHeaderValue(java.lang.String name, java.lang.String value)
name
- Name of the header.value
- Value of the header.public void setHeader(java.lang.String name, java.lang.String value)
name
- Name of the header.value
- Value of the header.public void setHeader(java.lang.String name, java.lang.String[] values)
name
- Name of the header.value
- String[] of header values.public java.lang.String[] getHeaderValue(java.lang.String name)
name
- Name of the header.public java.util.Set getHeaderNames()
?? 2022 Perforce Software, All rights reserved
This software is the confidential and proprietary information of Perforce, Inc. and is subject to copyright protection under laws of the United States of America and other countries. The use of this software should be in accordance with the license agreement terms you entered into with Perforce, Inc.