public class

Upload

extends Object
java.lang.Object
   ↳ fm.audiobox.core.net.Upload

Class Overview

Uploads media files to AudioBox Cloud.

Summary

Public Constructors
Upload(AudioBoxClient audioBoxClient, File file, NetworkProgressListener listener)
Instantiates a new Upload.
Public Methods
NetworkProgressListener getListener()
Gets listener.
void setListener(NetworkProgressListener listener)
Sets listener.
MediaFile start()
Starts to upload media files to AudioBox Cloud.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Upload (AudioBoxClient audioBoxClient, File file, NetworkProgressListener listener)

Instantiates a new Upload.

Parameters
audioBoxClient the client
file the file to upload on AudioBox
listener the listener

Public Methods

public NetworkProgressListener getListener ()

Gets listener.

Returns
  • the listener

public void setListener (NetworkProgressListener listener)

Sets listener.

Parameters
listener the listener

public MediaFile start ()

Starts to upload media files to AudioBox Cloud.

If the subscription is not valid 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.

Returns
  • a MediaFile containing additional information
Throws
AudioBoxException if any of the remote error exception is detected.
IllegalStateException if the operation is already running or it's completed
IOException if any connection problem occurs.