Class FileSizeConverter

  • All Implemented Interfaces:
    org.springframework.core.convert.converter.Converter<java.lang.Long,​java.lang.String>

    public class FileSizeConverter
    extends java.lang.Object
    implements org.springframework.core.convert.converter.Converter<java.lang.Long,​java.lang.String>
    Converts a files size (originally in bytes) to Kilobytes
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String convert​(java.lang.Long size)
      Converts a file length property (bytes) to kilobytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.springframework.core.convert.converter.Converter

        andThen
    • Constructor Detail

      • FileSizeConverter

        public FileSizeConverter()
    • Method Detail

      • convert

        public java.lang.String convert​(java.lang.Long size)
        Converts a file length property (bytes) to kilobytes.
        Specified by:
        convert in interface org.springframework.core.convert.converter.Converter<java.lang.Long,​java.lang.String>
        Parameters:
        size - Length property for a file
        Returns:
        String formatted size of file in kilobytes.