Class ByteSizeFormatter
- java.lang.Object
-
- org.hippoecm.frontend.plugins.standards.util.ByteSizeFormatter
-
- All Implemented Interfaces:
Serializable
,org.apache.wicket.util.io.IClusterable
public class ByteSizeFormatter extends Object implements org.apache.wicket.util.io.IClusterable
Formats numeric byte values into human-readable strings.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ByteSizeFormatter()
ByteSizeFormatter(int decimalPlaces)
ByteSizeFormatter(String gigabyteSuffix, String megabyteSuffix, String kilobyteSuffix, String byteSuffix, int decimalPlaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(long filesize)
Formats filesize in bytes as appropriate to bytes, KB, MB or GB.String
format(long filesize, Locale loc)
Formats filesize in bytes as appropriate to bytes, KB, MB or GB, based on the givenlocale
.
-
-
-
Method Detail
-
format
public String format(long filesize)
Formats filesize in bytes as appropriate to bytes, KB, MB or GB. By default, it formats based on the current user's locale information if available.- Parameters:
filesize
- in bytes- Returns:
- formatted filesize
-
-