Repository navigation
Conversation
There was a problem hiding this comment.
Agent review
The only change is an empty if (Files.isDirectory(source)) stub in moveToTrash. It has no effect, directories still throw ResourceNotFoundException, and there are no tests. See the inline comment.
Generated by Pull Request Review for #193 · copilot · auto · 10.1 AIC · ⌖ 0.509 AIC · ⊞ 7.1K
| Path source = Paths.get(rootPath, relativeFilePath).normalize(); | ||
| FileUtils.validatePath(rootPath, source); | ||
| if (Files.isDirectory(source)) { | ||
| // handle directory deletion. |
There was a problem hiding this comment.
This block is empty, so it does nothing. A directory path (e.g. moveToTrash(root, uid, "docs")) skips the block and then fails the !Files.isRegularFile(source) check just below with ResourceNotFoundException. Behaviour is unchanged. If directory trashing is meant to be implemented here, it needs real logic (move the tree, record trash metadata, restore support) plus tests. Otherwise drop this dead stub. Please don't merge a placeholder that appears to handle directories but doesn't.
Summary
Handle folder deletion to go through TrashService.
Currently, folder deletion is a simple recursive deletion of the provided directory, and does not go through the TrashService functionality. A brief explanation to what needs to be achieved is provided in
ResourceShareService:This PR attempts to implement this functionality.
AC:
Linked issue
Closes #155
How to test
Notes / Risk