wicket.util.resource
Class UrlResourceStream

java.lang.Object
  extended by wicket.util.resource.AbstractResourceStream
      extended by wicket.util.resource.UrlResourceStream
All Implemented Interfaces:
java.io.Serializable, IResourceStream, IStringResourceStream, IModifiable

public class UrlResourceStream
extends AbstractResourceStream

UrlResourceStream implements IResource for URLs.

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

Constructor Summary
UrlResourceStream(java.net.URL url)
          Construct.
 
Method Summary
 void close()
          Closes this resource.
 java.lang.String getContentType()
          Gets the mime type of this resource
 java.io.InputStream getInputStream()
          Gets the resource stream.
 java.net.URL getURL()
           
 Time lastModifiedTime()
          Gets the last time this modifiable thing changed.
 long length()
          Gets the size of this resource
 java.lang.String toString()
           
 
Methods inherited from class wicket.util.resource.AbstractResourceStream
asString, getCharset, getLocale, setCharset, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlResourceStream

public UrlResourceStream(java.net.URL url)
Construct.

Parameters:
url - URL of resource
Method Detail

close

public void close()
           throws java.io.IOException
Closes this resource.

Throws:
java.io.IOException

getContentType

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

Returns:
The content type of this resource, such as "image/jpeg" or "text/html"

getInputStream

public java.io.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.

Returns:
A readable input stream for this resource.
Throws:
ResourceStreamNotFoundException
See Also:
IResourceStream.close()

getURL

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

lastModifiedTime

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

Returns:
The last time this resource was modified
See Also:
IModifiable.lastModifiedTime()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

length

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

Returns:
The size of this resource in the number of bytes
See Also:
IResourceStream.length()


Copyright © 2004-2007 Wicket developers. All Rights Reserved.