org.apache.wicket.util.resource
Class ResourceStreamWrapper

java.lang.Object
  extended by org.apache.wicket.util.resource.ResourceStreamWrapper
All Implemented Interfaces:
Closeable, Serializable, IClusterable, IResourceStream, IModifiable

public class ResourceStreamWrapper
extends Object
implements IResourceStream

A IResourceStream that wraps another resource stream

See Also:
Serialized Form

Constructor Summary
ResourceStreamWrapper(IResourceStream delegate)
           
 
Method Summary
 void close()
          Closes the resource.
 String getContentType()
          Gets the mime type of this resource
 IResourceStream getDelegate()
           
 InputStream getInputStream()
          Gets the resource stream.
 Locale getLocale()
           
 String getStyle()
           
 String getVariation()
           
 Time lastModifiedTime()
          Gets the last time this modifiable thing changed.
 Bytes length()
          Gets the size of this resource
 void setLocale(Locale locale)
          This method shouldn't be used from the outside.
 void setStyle(String style)
          This method shouldn't be used from the outside.
 void setVariation(String variation)
          This method shouldn't be used from the outside.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceStreamWrapper

public ResourceStreamWrapper(IResourceStream delegate)
Method Detail

getDelegate

public IResourceStream getDelegate()

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

length

public Bytes length()
Description copied from interface: IResourceStream
Gets the size of this resource

Specified by:
length in interface IResourceStream
Returns:
The size of this resource in the number of bytes, or null if unknown

getInputStream

public InputStream getInputStream()
                           throws ResourceStreamNotFoundException
Description copied from interface: IResourceStream
Gets the resource stream. You should not directly close this stream. Instead call the close() method on IResourceStream.

Specified by:
getInputStream in interface IResourceStream
Returns:
Returns the inputStream.
Throws:
ResourceStreamNotFoundException
See Also:
IResourceStream.close()

close

public void close()
           throws IOException
Description copied from interface: IResourceStream
Closes the resource. Normally, this includes closing any underlying input stream returned by getInputStream().

Specified by:
close in interface Closeable
Specified by:
close in interface IResourceStream
Throws:
IOException

getLocale

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

setLocale

public void setLocale(Locale locale)
Description copied from interface: IResourceStream
This method shouldn't be used from 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.

getStyle

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

setStyle

public void setStyle(String style)
Description copied from interface: IResourceStream
This method shouldn't be used from 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.

getVariation

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

setVariation

public void setVariation(String variation)
Description copied from interface: IResourceStream
This method shouldn't be used from 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.

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 or null if that information is not available


Copyright © 2006–2019 Apache Software Foundation. All rights reserved.