com.atlassian.jira.web.util
Class FileSize

java.lang.Object
  |
  +--com.atlassian.jira.web.util.FileSize

public class FileSize
extends java.lang.Object

A class that contains utility methods for formatting the size of files into human readable form.


Constructor Summary
FileSize()
           
 
Method Summary
static java.lang.String format(long filesize)
          Format the size of a file in human readable form.
static java.lang.String format(java.lang.Long filesize)
          Convenience method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSize

public FileSize()
Method Detail

format

public static java.lang.String format(java.lang.Long filesize)
Convenience method. Calls format(long filesize).

Parameters:
filesize - The size of the file in bytes.
Returns:
The size in human readable form.
See Also:
format(long)

format

public static java.lang.String format(long filesize)
Format the size of a file in human readable form. Anything less than a kilobyte is presented in kilobytes to one decimal place. Anything between a kilobyte and a megabyte is presented in kilobytes with to zero decimal places. Anything greater than one megabyte is presented in megabytes to two decimal places.

eg.

Parameters:
filesize - The size of the file in bytes.
Returns:
The size in human readable form.


Copyright © 2002-2003 Atlassian. All Rights Reserved.