org.apache.wicket.util.resource
Class AbstractResourceStream

java.lang.Object
  extended by org.apache.wicket.util.resource.AbstractResourceStream
All Implemented Interfaces:
Closeable, Serializable, IClusterable, IResourceStream, IStringResourceStream, IModifiable
Direct Known Subclasses:
AbstractStringResourceStream, FileResourceStream, PackageResourceStream, UrlResourceStream, WebExternalResourceStream, XSLTResourceStream, ZipResourceStream

public abstract class AbstractResourceStream
extends Object
implements IStringResourceStream

Author:
Jonathan Locke
See Also:
IResourceStream, Serialized Form

Constructor Summary
AbstractResourceStream()
           
 
Method Summary
 String asString()
           
protected  Charset getCharset()
           
 String getContentType()
          Gets the mime type of this resource
 Locale getLocale()
           
 String getStyle()
           
 String getVariation()
           
 Time lastModifiedTime()
          Gets the last time this modifiable thing changed.
 long length()
          Gets the size of this resource in bytes TODO 1.5: rename to lengthInBytes() or let it return some sort of size object
 void setCharset(Charset charset)
          Sets the character set used for reading this resource.
 void setLocale(Locale locale)
          This method shouldn't be used for the outside, It is used by the Loaders to set the resolved locale.
 void setStyle(String style)
          This method shouldn't be used for the outside, It is used by the Loaders to set the resolved Style.
 void setVariation(String variation)
          This method shouldn't be used for the outside, It is used by the Loaders to set the resolved variation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.util.resource.IResourceStream
close, getInputStream
 

Constructor Detail

AbstractResourceStream

public AbstractResourceStream()
Method Detail

setCharset

public void setCharset(Charset charset)
Sets the character set used for reading this resource.

Specified by:
setCharset in interface IStringResourceStream
Parameters:
charset - Charset for component

asString

public String asString()
Specified by:
asString in interface IStringResourceStream
Returns:
This resource as a String.

getCharset

protected Charset getCharset()
Returns:
Charset for resource

getLocale

public Locale getLocale()
Specified by:
getLocale in interface IResourceStream
Returns:
The Locale where this stream did resolve to
See Also:
IResourceStream.getLocale()

setLocale

public void setLocale(Locale locale)
Description copied from interface: IResourceStream
This method shouldn't be used for the outside, It is used by the Loaders to set the resolved locale.

Specified by:
setLocale in interface IResourceStream
Parameters:
locale - The Locale where this stream did resolve to.
See Also:
IResourceStream.setLocale(java.util.Locale)

getStyle

public String getStyle()
Specified by:
getStyle in interface IResourceStream
Returns:
The Style where this stream did resolve to
See Also:
IResourceStream.getStyle()

getVariation

public String getVariation()
Specified by:
getVariation in interface IResourceStream
Returns:
The Variation where this stream did resolve to
See Also:
IResourceStream.getVariation()

setStyle

public void setStyle(String style)
Description copied from interface: IResourceStream
This method shouldn't be used for the outside, It is used by the Loaders to set the resolved Style.

Specified by:
setStyle in interface IResourceStream
Parameters:
style - The style where this stream did resolve to.
See Also:
IResourceStream.setStyle(java.lang.String)

setVariation

public void setVariation(String variation)
Description copied from interface: IResourceStream
This method shouldn't be used for the outside, It is used by the Loaders to set the resolved variation.

Specified by:
setVariation in interface IResourceStream
Parameters:
variation - The Variation where this stream did resolve to.
See Also:
IResourceStream.setVariation(java.lang.String)

length

public long length()
Description copied from interface: IResourceStream
Gets the size of this resource in bytes TODO 1.5: rename to lengthInBytes() or let it return some sort of size object

Specified by:
length in interface IResourceStream
Returns:
The size of this resource in the number of bytes, or -1 if unknown
See Also:
IResourceStream.length()

getContentType

public String getContentType()
Description copied from interface: IResourceStream
Gets the mime type of this resource

Specified by:
getContentType in interface IResourceStream
Returns:
The mime type of this resource, such as "image/jpeg" or "text/html". Return null to let ResourceStreamRequestHandler handle the Content-Type automatically
See Also:
IResourceStream.getContentType()

lastModifiedTime

public Time lastModifiedTime()
Description copied from interface: IModifiable
Gets the last time this modifiable thing changed.

Specified by:
lastModifiedTime in interface IModifiable
Returns:
the last modification Time
See Also:
IModifiable.lastModifiedTime()


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.