AnzhiZhang commented on code in PR #3715:
URL: https://github.com/apache/texera/pull/3715#discussion_r2331591621
##########
core/file-service/src/main/scala/edu/uci/ics/texera/service/resource/DatasetResource.scala:
##########
@@ -1280,29 +1322,29 @@ class DatasetResource {
private def resolveDatasetAndPath(
encodedUrl: String,
- datasetName: String,
+ repositoryName: String,
commitHash: String,
uid: Integer
): Either[Response, (String, String, String)] = {
val decodedPathStr = URLDecoder.decode(encodedUrl,
StandardCharsets.UTF_8.name())
- (Option(datasetName), Option(commitHash)) match {
+ (Option(repositoryName), Option(commitHash)) match {
case (Some(_), None) | (None, Some(_)) =>
// Case 1: Only one parameter is provided (error case)
Left(
Response
.status(Response.Status.BAD_REQUEST)
.entity(
- "Both datasetName and commitHash must be provided together, or
neither should be provided."
+ "Both repositoryName and commitHash must be provided together,
or neither should be provided."
)
.build()
)
- case (Some(dsName), Some(commit)) =>
- // Case 2: datasetName and commitHash are provided, validate access
+ case (Some(repositoryName), Some(commit)) =>
+ // Case 2: repositoryName and commitHash are provided, validate access
val response = withTransaction(context) { ctx =>
val datasetDao = new DatasetDao(ctx.configuration())
- val datasets = datasetDao.fetchByName(dsName).asScala.toList
+ val datasets =
datasetDao.fetchByRepositoryName(repositoryName).asScala.toList
Review Comment:
We created a new repository name, this is correct.
##########
core/file-service/src/main/scala/edu/uci/ics/texera/service/resource/DatasetResource.scala:
##########
@@ -1311,17 +1353,18 @@ class DatasetResource {
// Standard read access check only - download restrictions handled
per endpoint
// Non-download operations (viewing) should work for all public
datasets
- (dsName, commit, decodedPathStr)
+ (repositoryName, commit, decodedPathStr)
}
Right(response)
case (None, None) =>
- // Case 3: Neither datasetName nor commitHash are provided, resolve
normally
+ // Case 3: Neither repositoryName nor commitHash are provided, resolve
normally
val response = withTransaction(context) { ctx =>
val fileUri = FileResolver.resolve(decodedPathStr)
val document =
DocumentFactory.openReadonlyDocument(fileUri).asInstanceOf[OnDataset]
val datasetDao = new DatasetDao(ctx.configuration())
- val datasets =
datasetDao.fetchByName(document.getDatasetName()).asScala.toList
+ val datasets =
+
datasetDao.fetchByRepositoryName(document.getRepositoryName()).asScala.toList
Review Comment:
Same as above - We created a new repository name, this is correct.
--
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]