org.apache.wicket.core.util.resource
Class PackageResourceStream

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

public class PackageResourceStream
extends AbstractResourceStream

An IResourceStream that reads data from a resource in the classpath. It simply delegates all operations to the IResourceStream returned by the application's IResourceStreamLocator.

Author:
Jean-Baptiste Quenot
See Also:
Serialized Form

Constructor Summary
PackageResourceStream(Class<?> scope, String path)
          Obtains an IResourceStream from the application's IResourceStreamLocator.locate(Class, String)
 
Method Summary
 void close()
           
 String getContentType()
           
 InputStream getInputStream()
           
 Time lastModifiedTime()
           
 Bytes length()
           
 
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, toString, wait, wait, wait
 

Constructor Detail

PackageResourceStream

public PackageResourceStream(Class<?> scope,
                             String path)
Obtains an IResourceStream from the application's IResourceStreamLocator.locate(Class, String)

Parameters:
scope - This argument will be used to get the class loader for loading the package resource, and to determine what package it is in.
path - The path to the resource
Method Detail

close

public void close()
           throws IOException
Throws:
IOException

getContentType

public String getContentType()
Specified by:
getContentType in interface IResourceStream
Overrides:
getContentType in class AbstractResourceStream

getInputStream

public InputStream getInputStream()
                           throws ResourceStreamNotFoundException
Throws:
ResourceStreamNotFoundException

length

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

lastModifiedTime

public Time lastModifiedTime()
Specified by:
lastModifiedTime in interface IModifiable
Overrides:
lastModifiedTime in class AbstractResourceStream


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