CB-5524 rm resource validation fix (#3091)

This commit is contained in:
Ainur
2024-11-25 10:50:44 +00:00
committed by GitHub
parent d2f592c8be
commit f3660fa277
@@ -437,6 +437,9 @@ public class LocalResourceController extends BaseLocalResourceController {
if (Files.exists(newTargetPath)) {
throw new DBException("Resource with name %s already exists".formatted(newTargetPath.getFileName()));
}
if (!Files.exists(newTargetPath.getParent())) {
throw new DBException("Resource %s doesn't exists".formatted(newTargetPath.getParent().getFileName()));
}
try {
Files.move(oldTargetPath, newTargetPath);
} catch (IOException e) {