-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[UNDERTOW-2404] Add default sorting by type and name in directory lis… #1660
Conversation
d669b70
to
fe9818b
Compare
|
||
int state = 0; | ||
String parent = getParentPath(path, state); | ||
|
||
SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss", Locale.US); |
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.
Why? Its an enhancement, lets improve and ditch imperials( or possibly Locale.getDefault() and make decision based on this info?
Comparator<Resource> comparator; | ||
if ("lastModified".equals(sortColumn)) { | ||
comparator = Comparator.comparing( | ||
entry -> (entry.getLastModified() == null) ? new Date(0L) : entry.getLastModified() |
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.
How this can be null?
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.
if its somehow possible, maybe just use creation date rather than 1970 ?
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.
There is no creation date, but I think using a string like Unknown
or Not Available
. What do you think?
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.
It makes sense to me. As we sure that it is possible to get a null here? Maybe we even want to have something like: "-"
Such as: last modified: -
fe9818b
to
b887985
Compare
Comparator<Resource> comparator; | ||
if ("lastModified".equals(sortColumn)) { | ||
comparator = Comparator.comparing( | ||
entry -> (entry.getLastModified() == null) ? new Date(0L) : entry.getLastModified() |
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.
It makes sense to me. As we sure that it is possible to get a null here? Maybe we even want to have something like: "-"
Such as: last modified: -
eb1c957
to
6b4575f
Compare
…ting view; enable clickable name and size column headers for custom sorting
…ting view; enable clickable name and size column headers for custom sorting
https://issues.redhat.com/browse/UNDERTOW-2404