Package com.cloudinary.android.payload
Class FilePayload
java.lang.Object
com.cloudinary.android.payload.Payload<java.lang.String>
com.cloudinary.android.payload.FilePayload
public class FilePayload extends Payload<java.lang.String>
This class is used to handle uploading of images/videos represented as a
File-
Field Summary
-
Constructor Summary
Constructors Constructor Description FilePayload()FilePayload(java.lang.String filePath) -
Method Summary
Modifier and Type Method Description longgetLength(android.content.Context context)Get the length of the resource in bytesjava.lang.Objectprepare(android.content.Context context)Prepares the payload to upload to Cloudinaryjava.lang.StringtoUri()Constructs a uri of the data to upload, for serialization.
-
Constructor Details
-
FilePayload
public FilePayload(java.lang.String filePath) -
FilePayload
public FilePayload()
-
-
Method Details
-
getLength
Description copied from class:PayloadGet the length of the resource in bytes- Specified by:
getLengthin classPayload<java.lang.String>- Parameters:
context- Android context.- Returns:
- The length
- Throws:
PayloadNotFoundException- in case the resource doesn't exist.
-
prepare
Description copied from class:PayloadPrepares the payload to upload to Cloudinary- Specified by:
preparein classPayload<java.lang.String>- Parameters:
context- Android context- Returns:
- An object formatted for Cloudinary uploader. This can be one of InputStream, Byte array, File object or an absolute path (as string).
- Throws:
PayloadNotFoundException- If the request file or resource does not exist.
-
toUri
public java.lang.String toUri()Description copied from class:PayloadConstructs a uri of the data to upload, for serialization.
-