Package dev.dosya.sdk.model
Class UploadParams
java.lang.Object
dev.dosya.sdk.model.UploadParams
Parameters for uploading a file to a Dosya workspace.
Use the static factory methods to create instances from byte arrays, files, or streams.
UploadParams params = UploadParams.fromFile("ws_123", new File("report.pdf"))
.mimeType("application/pdf")
.folderId("folder_456")
.onProgress(p -> System.out.println(p.getPercent() + "%"));
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull UploadParamsstatic @NotNull UploadParamsstatic @NotNull UploadParamsfromStream(@NotNull String workspaceId, @NotNull String fileName, @NotNull InputStream stream, long fileSize) byte @NotNull []getBody()@Nullable String@NotNull Stringlong@Nullable String@Nullable String@Nullable Consumer<UploadProgress>@Nullable String@NotNull StringonProgress(Consumer<UploadProgress> onProgress)
-
Method Details
-
fromBytes
@NotNull public static @NotNull UploadParams fromBytes(@NotNull @NotNull String workspaceId, @NotNull @NotNull String fileName, byte @NotNull [] data) -
fromFile
@NotNull public static @NotNull UploadParams fromFile(@NotNull @NotNull String workspaceId, @NotNull @NotNull File file) throws IOException - Throws:
IOException
-
fromStream
@NotNull public static @NotNull UploadParams fromStream(@NotNull @NotNull String workspaceId, @NotNull @NotNull String fileName, @NotNull @NotNull InputStream stream, long fileSize) throws IOException - Throws:
IOException
-
mimeType
-
region
-
folderId
-
fileId
-
onProgress
-
getWorkspaceId
-
getFileName
-
getFileSize
public long getFileSize() -
getBody
public byte @NotNull [] getBody() -
getMimeType
-
getRegion
-
getFolderId
-
getFileId
-
getOnProgress
-