https://bz.apache.org/bugzilla/show_bug.cgi?id=69372
Bug ID: 69372
Summary: Make DefaultServlet's HTML listing file size rendering
better (autoscale)
Product: Tomcat 9
Version: 9.0.95
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
Created attachment 39891
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39891&action=edit
Reduced version of FileSizeFormat.java from Maven
Right now DefaultServlet#renderSize(long) scales very simply. To produce better
output one needs to subclass and override that method, clumsy. I'd like to
propose a better default implementation: almost 8 years ago I have written an
autoscaling FileSizeFormat class
(https://github.com/apache/maven/commit/149cce7a867956efeaf72d527f61297bf2471b1e#diff-8f8474d089262b816648e91ca292ea4f9e996c8958c1f86e9a1a013443007447)
for Maven which serves still today and has been even efficiency-optimized in
Maven 4
(https://github.com/apache/maven/commit/94749041b421f8e415174deb05e99563d65c25ee).
It properly use decimal prefixes (SI) for file (not memory, those should be IEC
binary prefixes) storage and scales upto gigabytes. Non-required methods can be
removed.
If there is general concensus I'd like to import that class into .util package
and use it. As a bonus (if desired only) we could make the scale unit
configurable: auto (default), byte, kilobyte, megabyte, gigabyte.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]