Skip to content

Commit

Permalink
Delete file
Browse files Browse the repository at this point in the history
  • Loading branch information
benmoriceau committed Nov 22, 2024
1 parent e45fa01 commit 67e3595
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ class ObjectStorageStreamLoader<T : RemoteObject<*>, U : OutputStream>(
)

val metadata = ObjectStorageDestinationState.metadataFor(stream)
val localFile = File(file.fileMessage.fileUrl!!)
val obj =
client.streamingUpload(key, metadata, streamProcessor = compressor) { outputStream ->
File(file.fileMessage.fileUrl!!).inputStream().use { it.copyTo(outputStream) }
localFile.inputStream().use { it.copyTo(outputStream) }
}
localFile.delete()
return FinalizedObject(remoteObject = obj)
}

Expand Down

0 comments on commit 67e3595

Please sign in to comment.