Package com.cloudinary.android.payload
Class Payload<T>
java.lang.Object
com.cloudinary.android.payload.Payload<T>
- Direct Known Subclasses:
ByteArrayPayload,FilePayload,LocalUriPayload,ResourcePayload
public abstract class Payload<T>
extends java.lang.Object
Representation of a resource to upload
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object o)TgetData()abstract longgetLength(android.content.Context context)Get the length of the resource in bytesinthashCode()abstract java.lang.Objectprepare(android.content.Context context)Prepares the payload to upload to Cloudinaryabstract java.lang.StringtoUri()Constructs a uri of the data to upload, for serialization.
-
Field Details
-
Constructor Details
-
Method Details
-
toUri
public abstract java.lang.String toUri()Constructs a uri of the data to upload, for serialization.- Returns:
- The string representation of the uri.
-
getLength
Get the length of the resource in bytes- Parameters:
context- Android context.- Returns:
- The length
- Throws:
PayloadNotFoundException- in case the resource doesn't exist.
-
prepare
public abstract java.lang.Object prepare(android.content.Context context) throws PayloadNotFoundExceptionPrepares the payload to upload to Cloudinary- 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.
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
getData
-