Package com.flagright.api.core
Class FileStream
- java.lang.Object
-
- com.flagright.api.core.FileStream
-
public class FileStream extends java.lang.ObjectRepresents 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.MediaTypegetContentType()java.lang.StringgetFileName()java.io.InputStreamgetInputStream()okhttp3.RequestBodytoRequestBody()Creates a RequestBody suitable for use with OkHttp client.
-
-
-
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.
-
-