-
Notifications
You must be signed in to change notification settings - Fork 5k
[Fix-17177] Fix cos resource can not list #17178
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
Conversation
|
Please follow the code style of |
@ruanwenjun hi |
54ead0a to
c7ccace
Compare
If the |
The function |
Sorry, I mean if the path is a file not directory, can this work? |
not work, But this method is to list the details of the directory, when will pass a file path? |
You need to follow the interface definition Lines 132 to 140 in bdec8b1
I have point this before #17178 (comment) |
- Optimize the listStorageEntity method to handle queries for files and directories - Add a check for whether the path ends with `File.separator` to distinguish between file and directory queries - Add object existence checks to improve query efficiency and accuracy
- Optimize the listStorageEntity method to handle queries for files and directories - Add a check for whether the path ends with `File.separator` to distinguish between file and directory queries - Add object existence checks to improve query efficiency and accuracy
|
@ruanwenjun PTAL Directory Intent: If the input path ends with File.separator, it is directly treated as a directory for querying. If the path is a file not directory, it`s still work well Known Issues: Naming Conflict: If a directory contains both a file and a folder with the same name (and the input path lacks a trailing File.separator), the file will be returned by default. This is intentional—users should append File.separator to explicitly target directories. Extension Check: The current method to distinguish files from directories (checking for a . in the path) is not entirely reliable. This is a separate issue and will be addressed in a future PR if needed. |
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
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.
LGTM.
Right now, we can only judge whether the path is file or directory by file name, this is incorrect when the file doesn't have extention, since we don't store the file metadata, we need to provide an additional parameter isDirectory in the controller, then listStorageEntity can only used to visit the directory.
SbloodyS
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.
+1
Purpose of the pull request
close #17177
Brief change log
fix cos can not list
fix cos list lost folders