Skip to content

Conversation

@rharithra
Copy link

No description provided.

Comment on lines +74 to +94
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
}
Copy link
Member

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

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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!

@DenizAltunkapan
Copy link
Member

@rharithra Thank you for your contribution

@DenizAltunkapan
Copy link
Member

@rharithra still working on it?

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.

2 participants