org.wings
Class Resource

java.lang.Object
  extended by org.wings.Resource
All Implemented Interfaces:
Serializable, Renderable, URLResource
Direct Known Subclasses:
DynamicResource, SByteArrayIcon, StaticResource, StringResource

public abstract class Resource
extends Object
implements Serializable, URLResource, Renderable

Wrapper to decorate various resource (i.e. images, files, scripts) with a MIME type and make it accessible to the client via HTTP and the ExternalizeManager.

Author:
Armin Haaf, Henner Zeller
See Also:
Serialized Form

Nested Class Summary
static class Resource.HeaderEntry
          Internal structure to manage HTTP headers which should be delivered with a resource to the client.
 
Field Summary
protected  String extension
           
protected  Collection<HttpHeader> headers
           
protected  String id
           
protected  String mimeType
           
 
Constructor Summary
protected Resource()
           
protected Resource(String extension, String mimeType)
           
 
Method Summary
 String getExtension()
           
 Collection<HttpHeader> getHeaders()
           
 String getId()
           
 int getLength()
           
 String getMimeType()
          Returns the mime type of this resource.
 Session getSession()
           
abstract  SimpleURL getURL()
          returns the URL, this resource can be fetched from.
 void setHeaders(Collection<HttpHeader> headers)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.wings.Renderable
write
 

Field Detail

id

protected String id

extension

protected String extension

mimeType

protected String mimeType

headers

protected Collection<HttpHeader> headers
Constructor Detail

Resource

protected Resource(String extension,
                   String mimeType)

Resource

protected Resource()
Method Detail

getLength

public int getLength()

getExtension

public String getExtension()

getMimeType

public String getMimeType()
Returns the mime type of this resource.


setHeaders

public void setHeaders(Collection<HttpHeader> headers)

getHeaders

public Collection<HttpHeader> getHeaders()

getId

public String getId()

getURL

public abstract SimpleURL getURL()
Description copied from interface: URLResource
returns the URL, this resource can be fetched from. This URL may be relative, usually if generated from the externalizer.

Specified by:
getURL in interface URLResource

toString

public String toString()
Overrides:
toString in class Object

getSession

public Session getSession()


wingS Swings ;-)