Parcelablepublic final class DownloadRequest extends Object implements Parcelable
| Modifier and Type | Class | Description |
|---|---|---|
static class |
DownloadRequest.Builder |
A builder for download requests.
|
static class |
DownloadRequest.UnsupportedRequestException |
Thrown when the encoded request data belongs to an unsupported request type.
|
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>| Modifier and Type | Field | Description |
|---|---|---|
static Parcelable.Creator<DownloadRequest> |
CREATOR |
|
String |
customCacheKey |
Custom key for cache indexing, or null.
|
byte[] |
data |
Application defined data associated with the download.
|
String |
id |
The unique content id.
|
byte[] |
keySetId |
The key set id of the offline licence if the content is protected with DRM.
|
String |
mimeType |
The MIME type of this content.
|
List<StreamKey> |
streamKeys |
Stream keys to be downloaded.
|
Uri |
uri |
The uri being downloaded.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Modifier and Type | Method | Description |
|---|---|---|
DownloadRequest |
copyWithId(String id) |
Returns a copy with the specified ID.
|
DownloadRequest |
copyWithKeySetId(byte[] keySetId) |
Returns a copy with the specified key set ID.
|
DownloadRequest |
copyWithMergedRequest(DownloadRequest newRequest) |
Returns the result of merging
newRequest into this request. |
int |
describeContents() |
|
boolean |
equals(Object o) |
|
int |
hashCode() |
|
MediaItem |
toMediaItem() |
Returns a
MediaItem for the content defined by the request. |
String |
toString() |
|
void |
writeToParcel(Parcel dest,
int flags) |
public final String id
public final Uri uri
@Nullable public final String mimeType
DownloadService will infer the content type from the
uri.public final List<StreamKey> streamKeys
@Nullable public final byte[] keySetId
@Nullable public final String customCacheKey
public final byte[] data
public static final Parcelable.Creator<DownloadRequest> CREATOR
public DownloadRequest copyWithId(String id)
id - The ID of the copy.public DownloadRequest copyWithKeySetId(@Nullable byte[] keySetId)
keySetId - The key set ID of the copy.public DownloadRequest copyWithMergedRequest(DownloadRequest newRequest)
newRequest into this request. The requests must have the
same id.
The resulting request contains the stream keys from both requests. For all other member
variables, those in newRequest are preferred.
newRequest - The request being merged.IllegalArgumentException - If the requests do not have the same id.public MediaItem toMediaItem()
MediaItem for the content defined by the request.public int describeContents()
describeContents in interface Parcelablepublic void writeToParcel(Parcel dest, int flags)
writeToParcel in interface Parcelable