-
Notifications
You must be signed in to change notification settings - Fork 7
feat:add last-modified-at for both file and folder #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds last-modified timestamp tracking for both files and folders by introducing a lastModifiedAt field (in milliseconds) to the FileDto and FolderDto classes. The FolderService is updated to read and populate these timestamps from filesystem attributes.
Key Changes
- Added
lastModifiedAtfield to bothFileDtoandFolderDto - Updated
FolderService.readFolder()to read filesystem attributes and populate the new timestamp fields - Minor import reordering for better code organization
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| backend/src/main/java/cloudpage/dto/FileDto.java | Added lastModifiedAt field to store file modification timestamp |
| backend/src/main/java/cloudpage/dto/FolderDto.java | Added lastModifiedAt field to store folder modification timestamp |
| backend/src/main/java/cloudpage/service/FolderService.java | Updated to read and populate lastModifiedAt for files and folders using filesystem attributes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| folderAttrs.lastModifiedTime().toMillis() | ||
| ); | ||
| } catch (IOException e) { | ||
| throw new FileDeletionException("Failed to read folder attributes: " + path + " with exception: " + e.getMessage()); |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using FileDeletionException for a read operation is misleading. This exception should only be used for deletion failures. Consider creating a new exception type like FileReadException or use a more generic exception like RuntimeException with a descriptive message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| attrs.lastModifiedTime().toMillis() | ||
| ); | ||
| } catch (IOException e) { | ||
| throw new FileDeletionException("Failed to read: " + filePath + "with exception : " + e.getMessage()); |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before 'with exception'. Should be 'with exception :' (note: this is a pre-existing issue that also affects line 71).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this, also in Line 71 as Copilot mentioned.
DenizAltunkapan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! @JoaoCosme
| attrs.lastModifiedTime().toMillis() | ||
| ); | ||
| } catch (IOException e) { | ||
| throw new FileDeletionException("Failed to read: " + filePath + "with exception : " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this, also in Line 71 as Copilot mentioned.
| folderAttrs.lastModifiedTime().toMillis() | ||
| ); | ||
| } catch (IOException e) { | ||
| throw new FileDeletionException("Failed to read folder attributes: " + path + " with exception: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves #14