-
Notifications
You must be signed in to change notification settings - Fork 7
Pagination and sorting for file listings #17
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
| Usage | ||
| Pagination Example | ||
| List files with pagination | ||
| GET /api/files/list?page=0&size=20&sort=name,asc | ||
| Sample JSON response: | ||
| { | ||
| "content": [ | ||
| { | ||
| "name": "Doc1.txt", | ||
| "path": "/user/files/Doc1.txt", | ||
| "size": 12345, | ||
| "mimeType": "text/plain" | ||
| } | ||
| // ... | ||
| ], | ||
| "pageNumber": 0, | ||
| "totalElements": 52, | ||
| "totalPages": 3 | ||
| } | ||
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 remove these lines from the readme
| .header(HttpHeaders.CONTENT_TYPE, mimeType) | ||
| .body(resource); | ||
| } | ||
| @GetMapping("/list") |
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.
The new /list endpoint introduces database-backed pagination via FileEntityService.
While the implementation is clean, Cloud Page is designed to manage files directly on the filesystem.
Pagination should be implemented in FolderService.getFolderTree() instead, since the folder/file structure is dynamic and filesystem-based.
I recommend removing this endpoint to avoid confusion and duplication.
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.
I don't think that its smart to save the files in the db.
Assume the Server changes => then the db must synchronize with the corresponding folder.
Cloud Page intentionally manages files stored on disk — introducing a JPA layer means the filesystem and database will quickly get out of sync.
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.
shouldn’t exist unless the project’s architecture explicitly shifts from filesystem-based storage to database-indexed file metadata.
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.
you dont need this. There already exists a FileService
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.
This FileEntityService and DB-based approach is unnecessary—FileService already handles all filesystem operations, and pagination should be implemented in FolderService directly!
|
@rharithra Thank you for your contribution |
|
@rharithra still working on it? |
No description provided.