org.abstracthorizon.danube.webdav.util
Class SimpleHTMLCollectionRenderer

java.lang.Object
  extended by org.abstracthorizon.danube.webdav.util.SimpleHTMLCollectionRenderer
All Implemented Interfaces:
CollectionHTMLRenderer

public class SimpleHTMLCollectionRenderer
extends Object
implements CollectionHTMLRenderer

Simple HTML collection renderer. It is similar to other popular products' dir rendering

Author:
Daniel Sendula

Field Summary
static SimpleDateFormat dateFormat
          Date format
static long GIGABYTE
          Number of bytes in a gigabyte
static long KILOBYTE
          Number of bytes in a kilobyte
static long MEGABYTE
          Number of bytes in a megabyte
static long TERABYTE
          Number of bytes in a terabyte
 
Constructor Summary
SimpleHTMLCollectionRenderer()
           
 
Method Summary
protected  String encode(String string)
          URL encodes given string
protected  String getLengthAsString(ResourceAdapter adapter, Object f)
          Returns file length as a string
 void render(HTTPConnection httpConnection, ResourceAdapter adapter, Object dir)
          Renders the html
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateFormat

public static final SimpleDateFormat dateFormat
Date format


KILOBYTE

public static final long KILOBYTE
Number of bytes in a kilobyte

See Also:
Constant Field Values

MEGABYTE

public static final long MEGABYTE
Number of bytes in a megabyte

See Also:
Constant Field Values

GIGABYTE

public static final long GIGABYTE
Number of bytes in a gigabyte

See Also:
Constant Field Values

TERABYTE

public static final long TERABYTE
Number of bytes in a terabyte

See Also:
Constant Field Values
Constructor Detail

SimpleHTMLCollectionRenderer

public SimpleHTMLCollectionRenderer()
Method Detail

render

public void render(HTTPConnection httpConnection,
                   ResourceAdapter adapter,
                   Object dir)
Renders the html

Specified by:
render in interface CollectionHTMLRenderer
Parameters:
httpConnection - connection
adapter - resource adapter
dir - resource

getLengthAsString

protected String getLengthAsString(ResourceAdapter adapter,
                                   Object f)
Returns file length as a string

Parameters:
f - file
Returns:
file length as a string

encode

protected String encode(String string)
URL encodes given string

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


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.