org.apache.wicket.util.resource
Class UrlResourceStream

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

public class UrlResourceStream
extends AbstractResourceStream
implements IFixedLocationResourceStream

UrlResourceStream implements IResource for URLs.

Author:
Jonathan Locke, Igor Vaynberg
See Also:
IResourceStream, IModifiable, Serialized Form

Constructor Summary
UrlResourceStream(URL url)
          Construct.
 
Method Summary
 void close()
          Closes this resource.
 String getContentType()
           
 InputStream getInputStream()
           
 URL getURL()
           
 Time lastModifiedTime()
           
 Bytes length()
           
 String locationAsString()
           
 String toString()
           
 
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlResourceStream

public UrlResourceStream(URL url)
Construct.

Parameters:
url - URL of resource
Method Detail

close

public void close()
           throws IOException
Closes this resource.

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

getInputStream

public InputStream getInputStream()
                           throws ResourceStreamNotFoundException
Specified by:
getInputStream in interface IResourceStream
Returns:
A readable input stream for this resource.
Throws:
ResourceStreamNotFoundException

getURL

public URL getURL()
Returns:
The URL to this resource (if any)

lastModifiedTime

public Time lastModifiedTime()
Specified by:
lastModifiedTime in interface IModifiable
Overrides:
lastModifiedTime in class AbstractResourceStream
Returns:
The last time this resource was modified
See Also:
IModifiable.lastModifiedTime()

toString

public String toString()
Overrides:
toString in class Object

getContentType

public String getContentType()
Specified by:
getContentType in interface IResourceStream
Overrides:
getContentType in class AbstractResourceStream
Returns:
The content type of this resource, such as "image/jpeg" or "text/html"

length

public Bytes length()
Specified by:
length in interface IResourceStream
Overrides:
length in class AbstractResourceStream

locationAsString

public String locationAsString()
Specified by:
locationAsString in interface IFixedLocationResourceStream


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.