Pagination and sorting for file listings#17
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.
Please remove these lines from the readme
| .header(HttpHeaders.CONTENT_TYPE, mimeType) | ||
| .body(resource); | ||
| } | ||
| @GetMapping("/list") |
There was a problem hiding this comment.
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.
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.
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.
you dont need this. There already exists a FileService
There was a problem hiding this comment.
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.