Skip to content

Commit

Permalink
CB-5524 rm resource validation fix (#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
yagudin10 authored Nov 25, 2024
1 parent d2f592c commit f3660fa
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ public String moveResource(
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) {
Expand Down

0 comments on commit f3660fa

Please sign in to comment.