public class Upload
extends java.lang.Object
| Constructor and Description |
|---|
Upload(AudioBoxClient audioBoxClient,
java.io.File file,
NetworkProgressListener listener)
Instantiates a new Upload.
|
| Modifier and Type | Method and Description |
|---|---|
NetworkProgressListener |
getListener()
Gets listener.
|
void |
setListener(NetworkProgressListener listener)
Sets listener.
|
MediaFile |
start()
Starts to upload media files to AudioBox Cloud.
|
public Upload(AudioBoxClient audioBoxClient, java.io.File file, NetworkProgressListener listener)
audioBoxClient - the clientfile - the file to upload on AudioBoxlistener - the listenerpublic NetworkProgressListener getListener()
public void setListener(NetworkProgressListener listener)
listener - the listenerpublic MediaFile start() throws java.io.IOException, java.lang.IllegalStateException
ForbiddenException is thrown.
If a media file already exists on AudioBox Cloud FileAlreadyUploaded is thrown.
Other errors may include ValidationException,
SystemOverloadedException or RemoteMessageException
with additional information in the exception body.
The application should ensure to accept those errors and retry accordingly after few minutes.
On successful upload the server returns a new MediaFile with additional information,
including the token assigned to the newly uploaded media file.
Files uploaded through this method will go directly into the CloudPlaylist.
MediaFile containing additional informationAudioBoxException - if any of the remote error exception is detected.java.lang.IllegalStateException - if the operation is already running or it's completedjava.io.IOException - if any connection problem occurs.AudioBoxException