public class Media extends ResourceBase
/v1/users/{userId}/media
client, id, properties
dateFormat
Constructor and Description |
---|
Media(BandwidthClient client) |
Modifier and Type | Method and Description |
---|---|
static Media |
create()
Factory method for a Media object.
|
void |
download(java.lang.String mediaName,
java.io.File file)
Downloads existing media file from server.
|
static MediaFile |
get(BandwidthClient client,
java.lang.String id)
Gets information about a previously sent or received MediaFile.
|
static MediaFile |
get(java.lang.String id)
Gets information about a previously sent or received MediaFile.
|
protected java.lang.String |
getUri() |
static ResourceList<MediaFile> |
list()
Factory method for MediaFile list, returns a list of MediaFile object with default page, size
|
static ResourceList<MediaFile> |
list(BandwidthClient client,
int page,
int size)
Factory method for MediaFile list, returns a list of MediaFile objects with page, size preference
|
static ResourceList<MediaFile> |
list(int page,
int size)
Factory method for MediaFile list, returns a list of MediaFile objects with page, size preference
|
protected void |
setUp(org.json.simple.JSONObject jsonObject) |
MediaFile |
upload(java.lang.String mediaName,
java.io.File file,
MediaMimeType contentType)
Uploads media file.
|
getClient, getId, getProperties, setId, toJSONArray, toJSONObject
getProperty, getPropertyAsBoolean, getPropertyAsDate, getPropertyAsDouble, getPropertyAsLong, getPropertyAsString, getPropertyAsStringArray, putProperty, toMap, updateProperties
public Media(BandwidthClient client)
public static MediaFile get(java.lang.String id) throws java.lang.Exception
id
- media file idjava.io.IOException
- unexpected error.java.lang.Exception
public static MediaFile get(BandwidthClient client, java.lang.String id) throws java.lang.Exception
client
- the client.id
- MediaFile idjava.io.IOException
- unexpected error.java.lang.Exception
public static ResourceList<MediaFile> list() throws java.io.IOException
java.io.IOException
- unexpected error.public static ResourceList<MediaFile> list(int page, int size) throws java.io.IOException
page
- the pagesize
- the page sizejava.io.IOException
- unexpected error.public static ResourceList<MediaFile> list(BandwidthClient client, int page, int size) throws java.io.IOException
client
- the client.page
- the pagesize
- the page sizejava.io.IOException
- unexpected error.public static Media create()
protected void setUp(org.json.simple.JSONObject jsonObject)
setUp
in class ResourceBase
public MediaFile upload(java.lang.String mediaName, java.io.File file, MediaMimeType contentType) throws java.io.IOException, AppPlatformException
mediaName
- new name of media filefile
- source file for uploadingcontentType
- MIME type of file or null
java.io.IOException
- unexpected error.AppPlatformException
- unexpected exception.public void download(java.lang.String mediaName, java.io.File file) throws java.io.IOException
mediaName
- name of mediafile
- file for putting content. Will be overridden.java.io.IOException
- unexpected error.protected java.lang.String getUri()
Copyright © 2019. All Rights Reserved.