public final class Data extends Object
<data/> element in the urn:xmpp:bob namespace.
This class is immutable.
| Constructor and Description |
|---|
Data(byte[] bytes,
String type)
Constructs the data element.
|
Data(byte[] bytes,
String type,
Integer maxAge)
Constructs the data element.
|
Data(String cid)
Constructs the data element with a content id.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
createContendId(byte[] data)
Creates the content id.
|
byte[] |
getBytes()
Gets the bytes.
|
String |
getContentId()
A Content-ID that can be mapped to a cid: URL as specified in RFC 2111.
|
Integer |
getMaxAge()
A suggestion regarding how long (in seconds) to cache the data; the meaning matches the Max-Age attribute from RFC 2965.
|
String |
getType()
The value of the 'type' attribute MUST match the syntax specified in RFC 2045.
|
public static final String NAMESPACE
public Data(String cid)
cid - The contend id.public Data(byte[] bytes,
String type)
bytes - The bytes.type - The type.public static String createContendId(byte[] data)
The 'cid' value SHOULD be of the form algo+hash@bob.xmpp.org, where the "algo" is the hashing algorithm used (e.g., "sha1" for the SHA-1 algorithm as specified in RFC 3174 [11]) and the "hash" is the hex output of the algorithm applied to the binary data itself.
data - The data.public final String getContentId()
public final Integer getMaxAge()
public final String getType()
public final byte[] getBytes()
Copyright © 2014–2016 XMPP.rocks. All rights reserved.