Class FileStream


  • public class FileStream
    extends java.lang.Object
    Represents a file stream with associated metadata for file uploads.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileStream​(java.io.InputStream inputStream)  
      FileStream​(java.io.InputStream inputStream, java.lang.String fileName, okhttp3.MediaType contentType)
      Constructs a FileStream with the given input stream and optional metadata.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      okhttp3.MediaType getContentType()  
      java.lang.String getFileName()  
      java.io.InputStream getInputStream()  
      okhttp3.RequestBody toRequestBody()
      Creates a RequestBody suitable for use with OkHttp client.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileStream

        public FileStream​(java.io.InputStream inputStream,
                          @Nullable
                          java.lang.String fileName,
                          @Nullable
                          okhttp3.MediaType contentType)
        Constructs a FileStream with the given input stream and optional metadata.
        Parameters:
        inputStream - The input stream of the file content. Must not be null.
        fileName - The name of the file, or null if unknown.
        contentType - The MIME type of the file content, or null if unknown.
        Throws:
        java.lang.NullPointerException - if inputStream is null
      • FileStream

        public FileStream​(java.io.InputStream inputStream)
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
      • getFileName

        @Nullable
        public java.lang.String getFileName()
      • getContentType

        @Nullable
        public okhttp3.MediaType getContentType()
      • toRequestBody

        public okhttp3.RequestBody toRequestBody()
        Creates a RequestBody suitable for use with OkHttp client.
        Returns:
        A RequestBody instance representing this file stream.