Skip to content

Conversation

@JoaoCosme
Copy link

Resolves #14

Copilot AI review requested due to automatic review settings November 17, 2025 22:42
Copy link

Copilot AI left a 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 lastModifiedAt field to both FileDto and FolderDto
  • 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());
Copy link

Copilot AI Nov 17, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Member

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());
Copy link

Copilot AI Nov 17, 2025

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).

Copilot uses AI. Check for mistakes.
Copy link
Member

@DenizAltunkapan DenizAltunkapan Nov 18, 2025

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.

Copy link
Member

@DenizAltunkapan DenizAltunkapan left a 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());
Copy link
Member

@DenizAltunkapan DenizAltunkapan Nov 18, 2025

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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add last modified date field to files and folders

2 participants