ro.polak.utilities
Class Utilities

java.lang.Object
  extended by ro.polak.utilities.Utilities

public class Utilities
extends java.lang.Object

Utilities

Java Little Web Server Homepage

Version:
1.0/21.02.2008
Author:
Piotr Polak www.polak.ro

Constructor Summary
Utilities()
           
 
Method Summary
static void clearTemp()
          Once called, deletes all the files inside the temporary files directory
static java.lang.String fileSizeUnits(long size)
          Returns user friendly representation of file size
static java.lang.String getExtension(java.lang.String filename)
          Returns the extension sting for a given file path
static java.lang.String URLDecode(java.lang.String text)
          Decodes given string for URL/HTTP
static java.lang.String URLEncode(java.lang.String text)
          Encodes given string for URL/HTTP
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

getExtension

public static java.lang.String getExtension(java.lang.String filename)
Returns the extension sting for a given file path

Parameters:
filename - filepath or filename
Returns:
the extension part for a given file path

clearTemp

public static void clearTemp()
Once called, deletes all the files inside the temporary files directory


URLEncode

public static java.lang.String URLEncode(java.lang.String text)
Encodes given string for URL/HTTP

Parameters:
text - text to be encoded
Returns:
encoded string

URLDecode

public static java.lang.String URLDecode(java.lang.String text)
Decodes given string for URL/HTTP

Parameters:
text - text to be decoded
Returns:
decoded string

fileSizeUnits

public static java.lang.String fileSizeUnits(long size)
Returns user friendly representation of file size

Parameters:
size - size of a file
Returns:
formated size of the file using B, KB, MB, GB