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

    Fields inherited from class com.cloudinary.android.payload.Payload

    data
  • Constructor Summary

    Constructors 
    Constructor Description
    FilePayload()  
    FilePayload​(java.lang.String filePath)  
  • Method Summary

    Modifier and Type Method Description
    long getLength​(android.content.Context context)
    Get the length of the resource in bytes
    java.lang.Object prepare​(android.content.Context context)
    Prepares the payload to upload to Cloudinary
    java.lang.String toUri()
    Constructs a uri of the data to upload, for serialization.

    Methods inherited from class com.cloudinary.android.payload.Payload

    equals, getData, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getLength

      public long getLength​(android.content.Context context) throws PayloadNotFoundException
      Description copied from class: Payload
      Get the length of the resource in bytes
      Specified by:
      getLength in class Payload<java.lang.String>
      Parameters:
      context - Android context.
      Returns:
      The length
      Throws:
      PayloadNotFoundException - in case the resource doesn't exist.
    • prepare

      public java.lang.Object prepare​(android.content.Context context) throws PayloadNotFoundException
      Description copied from class: Payload
      Prepares the payload to upload to Cloudinary
      Specified by:
      prepare in class Payload<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: Payload
      Constructs a uri of the data to upload, for serialization.
      Specified by:
      toUri in class Payload<java.lang.String>
      Returns:
      The string representation of the uri.