madisonmlin commented on code in PR #3621:
URL: https://github.com/apache/texera/pull/3621#discussion_r2259062660


##########
core/file-service/src/main/scala/edu/uci/ics/texera/service/resource/DatasetResource.scala:
##########
@@ -1200,34 +1225,84 @@ class DatasetResource {
       commitHash: String,
       uid: Integer
   ): Response = {
+    resolveDatasetAndPath(encodedUrl, datasetName, commitHash, uid) match {
+      case Left(errorResponse) =>
+        errorResponse
+
+      case Right((resolvedDatasetName, resolvedCommitHash, resolvedFilePath)) 
=>
+        val url = LakeFSStorageClient.getFilePresignedUrl(
+          resolvedDatasetName,
+          resolvedCommitHash,
+          resolvedFilePath
+        )
+
+        Response.ok(Map("presignedUrl" -> url)).build()
+    }
+  }
+
+  private def generatePresignedResponseWithS3(
+      encodedUrl: String,
+      datasetName: String,
+      commitHash: String,
+      uid: Integer
+  ): Response = {
+    resolveDatasetAndPath(encodedUrl, datasetName, commitHash, uid) match {
+      case Left(errorResponse) =>
+        errorResponse
+
+      case Right((resolvedDatasetName, resolvedCommitHash, resolvedFilePath)) 
=>
+        val fileName = 
resolvedFilePath.split("/").lastOption.getOrElse("download")
+        val contentType = "application/octet-stream"
+        val EXPIRATION_MINUTES = 5

Review Comment:
   I've moved it to the DatasetResource class scope.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to