org.metasyntactic.io
Class FileSizeFormat

java.lang.Object
  |
  +--org.metasyntactic.io.FileSizeFormat

public class FileSizeFormat
extends java.lang.Object

Simple formatting mechanism for files that produces file size string identical to Windows®.


Method Summary
static java.lang.String format(java.io.File file)
          Returns a string representing the size of this file.
static java.lang.String format(long bytes)
          Returns a string representing this number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

format

public static java.lang.String format(java.io.File file)
Returns a string representing the size of this file.

Parameters:
file - The file to get the size from
Returns:
The size of the file in a nicely formatted string

format

public static java.lang.String format(long bytes)
Returns a string representing this number

Parameters:
bytes - The number to get the size from
Returns:
The size of the file in a nicely formatted string