ChengJie1053 commented on code in PR #2948:
URL:
https://github.com/apache/incubator-streampark/pull/2948#discussion_r1297948218
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Resource.java:
##########
@@ -82,4 +82,29 @@ public class Resource implements Serializable {
private transient String sortOrder;
private transient String connector;
+
+ public void setResourcePath(String resourcePath) {
+ if (resourcePath == null) {
+ throw new IllegalArgumentException("resource path cannot be null.");
+ }
+ String[] namePath = resourcePath.split(":");
+ if (namePath.length != 2) {
Review Comment:
Ok, thanks for reviewing the code
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java:
##########
@@ -204,13 +205,18 @@ public void deleteResource(Resource resource) {
Resource findResource = getById(resource.getId());
checkOrElseAlert(findResource);
- FsOperator.lfs()
- .delete(
- String.format(
- "%s/%d/%s",
- Workspace.local().APP_UPLOADS(),
- findResource.getTeamId(),
- findResource.getResourceName()));
+ String filePath =
+ String.format(
+ "%s/%d/%s",
+ Workspace.local().APP_UPLOADS(),
+ findResource.getTeamId(),
+ findResource.getResourceName());
+
+ if (!new File(filePath).exists() &&
StringUtils.isNotBlank(findResource.getFilePath())) {
Review Comment:
Ok, thanks for reviewing the code
--
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]