This is an automated email from the ASF dual-hosted git repository.
casionone pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/linkis.git
The following commit(s) were added to refs/heads/master by this push:
new 171e21c212 #AI COMMIT# Add S3 schema support in storage path
recognition and validation (#5436)
171e21c212 is described below
commit 171e21c2127daac6897f2455fbc07a8731ce7264
Author: aiceflower <[email protected]>
AuthorDate: Thu Jun 11 13:12:17 2026 +0800
#AI COMMIT# Add S3 schema support in storage path recognition and
validation (#5436)
Add S3_SCHEMA to StorageUtils.getFsPath() schema detection and
PathValidator.checkPath() validation to support s3:// storage paths.
Co-authored-by: Claude Opus 4.7 <[email protected]>
---
.../main/scala/org/apache/linkis/storage/utils/StorageUtils.scala | 3 ++-
.../scala/org/apache/linkis/filesystem/validator/PathValidator.scala | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
b/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
index f2948496ca..4f44455a00 100644
---
a/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
+++
b/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
@@ -205,7 +205,8 @@ object StorageUtils extends Logging {
*/
def getFsPath(path: String): FsPath = {
if (
- path.startsWith(FILE_SCHEMA) || path.startsWith(HDFS_SCHEMA) ||
path.startsWith(BLOB_SCHEMA)
+ path.startsWith(FILE_SCHEMA) || path
+ .startsWith(HDFS_SCHEMA) || path.startsWith(BLOB_SCHEMA) ||
path.startsWith(S3_SCHEMA)
) new FsPath(path)
else {
new FsPath(FILE_SCHEMA + path)
diff --git
a/linkis-public-enhancements/linkis-pes-publicservice/src/main/scala/org/apache/linkis/filesystem/validator/PathValidator.scala
b/linkis-public-enhancements/linkis-pes-publicservice/src/main/scala/org/apache/linkis/filesystem/validator/PathValidator.scala
index a323042db9..62b3885872 100644
---
a/linkis-public-enhancements/linkis-pes-publicservice/src/main/scala/org/apache/linkis/filesystem/validator/PathValidator.scala
+++
b/linkis-public-enhancements/linkis-pes-publicservice/src/main/scala/org/apache/linkis/filesystem/validator/PathValidator.scala
@@ -91,7 +91,10 @@ class PathValidator extends Logging {
var userHdfsRootPath: String =
WorkspaceUtil.suffixTuning(HDFS_USER_ROOT_PATH_PREFIX.getValue) +
username + HDFS_USER_ROOT_PATH_SUFFIX.getValue
- if (!(path.contains(StorageUtils.FILE_SCHEMA)) &&
!(path.contains(StorageUtils.HDFS_SCHEMA))) {
+ if (
+ !(path.contains(StorageUtils.FILE_SCHEMA)) && !(path
+ .contains(StorageUtils.HDFS_SCHEMA)) &&
!(path.contains(StorageUtils.S3_SCHEMA))
+ ) {
throw new WorkSpaceException(80025, "the path should contain schema")
}
userHdfsRootPath = StringUtils.trimTrailingCharacter(userHdfsRootPath,
File.separatorChar)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]