public class DrmRights extends Object
A caller can instantiate a DrmRights
object by first invoking the
DrmManagerClient.processDrmInfo(DrmInfo)
method and then using the resulting
ProcessedData
object to invoke the DrmRights(ProcessedData, String)
constructor.
A caller can also instantiate a DrmRights
object by using the
DrmRights(String, String)
constructor, which takes a path to a file
containing rights information instead of a ProcessedData
.
Please note that the account id and subscription id is not mandatory by all DRM agents or plugins. When account id or subscription id is not required by the specific DRM agent or plugin, they can be either null, or an empty string, or any other don't-care string value.
Constructor and Description |
---|
DrmRights(File rightsFile,
String mimeType)
Creates a
DrmRights object with the given parameters. |
DrmRights(ProcessedData data,
String mimeType)
Creates a
DrmRights object with the given parameters. |
DrmRights(String rightsFilePath,
String mimeType)
Creates a
DrmRights object with the given parameters. |
DrmRights(String rightsFilePath,
String mimeType,
String accountId)
Creates a
DrmRights object with the given parameters. |
DrmRights(String rightsFilePath,
String mimeType,
String accountId,
String subscriptionId)
Creates a
DrmRights object with the given parameters. |
Modifier and Type | Method and Description |
---|---|
String |
getAccountId()
Retrieves the account ID associated with this
DrmRights object. |
byte[] |
getData()
Retrieves the rights data associated with this
DrmRights object. |
String |
getMimeType()
Retrieves the MIME type associated with this
DrmRights object. |
String |
getSubscriptionId()
Retrieves the subscription ID associated with this
DrmRights object. |
public DrmRights(String rightsFilePath, String mimeType)
DrmRights
object with the given parameters.rightsFilePath
- Path to the file containing rights information.mimeType
- MIME type. Must not be null or an empty string.public DrmRights(String rightsFilePath, String mimeType, String accountId)
DrmRights
object with the given parameters.rightsFilePath
- Path to the file containing rights information.mimeType
- MIME type. Must not be null or an empty string.accountId
- Account ID of the user.public DrmRights(String rightsFilePath, String mimeType, String accountId, String subscriptionId)
DrmRights
object with the given parameters.rightsFilePath
- Path to the file containing rights information.mimeType
- MIME type. Must not be null or an empty string.accountId
- Account ID of the user.subscriptionId
- Subscription ID of the user.public DrmRights(File rightsFile, String mimeType)
DrmRights
object with the given parameters.rightsFile
- File containing rights information.mimeType
- MIME type. Must not be null or an empty string.public DrmRights(ProcessedData data, String mimeType)
DrmRights
object with the given parameters.data
- A ProcessedData
object containing rights information.
Must not be null.mimeType
- The MIME type. It must not be null or an empty string.public byte[] getData()
DrmRights
object.byte
array representing the rights data.public String getMimeType()
DrmRights
object.public String getAccountId()
DrmRights
object.public String getSubscriptionId()
DrmRights
object.