Closed jgoldhammer closed 8 years ago
Currently, the filesize is in bytes.
Please include a prettyprint for the filesize
Using commons-io, this would be very easy http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#byteCountToDisplaySize(long)
or maybe one of these solutions if you don´t want to have an external dependency http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java/3758880#3758880
One possiblity would to be to include this return FileUtils.byteCountToDisplaySize(size);
return FileUtils.byteCountToDisplaySize(size);
here https://github.com/lukashinsch/spring-boot-actuator-logview/blob/master/lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/FileEntry.java#L33
Thanks, Jens
Great idea, looks much nicer that way (should have thought about it when prettifying the date...) FileUtils is fine since commons-io is already a dependency.
Currently, the filesize is in bytes.
Please include a prettyprint for the filesize
Using commons-io, this would be very easy http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#byteCountToDisplaySize(long)
or maybe one of these solutions if you don´t want to have an external dependency http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java/3758880#3758880
One possiblity would to be to include this
return FileUtils.byteCountToDisplaySize(size);
here https://github.com/lukashinsch/spring-boot-actuator-logview/blob/master/lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/FileEntry.java#L33
Thanks, Jens