ruanwenjun commented on code in PR #16803:
URL:
https://github.com/apache/dolphinscheduler/pull/16803#discussion_r1845948753
##########
dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/StorageOperator.java:
##########
@@ -24,9 +24,6 @@
public interface StorageOperator {
- String FILE_FOLDER_NAME = "resources";
- String UDF_FOLDER_NAME = "udfs";
Review Comment:
Please Keep these two fields, we should avoid add all constants in
Constants, these fields in StorageOperator is also static. You can get these by
`StorageOperator.FILE_FOLDER_NAME`
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/resources/visitor/ResourceTreeVisitor.java:
##########
@@ -123,9 +124,15 @@ private static ResourceComponent
getResourceComponent(StorageEntity resource) {
tempResourceComponent = new FileLeaf();
}
+ String currentDir = "";
+ if (resource.getFullName().contains(Constants.RESOURCE_TYPE_FILE)) {
+ currentDir =
resource.getFullName().split(Constants.RESOURCE_TYPE_FILE)[1].substring(1);
+ }
Review Comment:
This is not safe, we should parse the `ResourceMetaData` and check whether
the `resource'resourceType` is `FILE`. You can find some code under
`AbstractStorageOperator#getResourceMetaData`
--
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]