Class PackageResourceStream
- java.lang.Object
-
- org.apache.wicket.util.resource.AbstractResourceStream
-
- org.apache.wicket.core.util.resource.PackageResourceStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,org.apache.wicket.util.io.IClusterable,org.apache.wicket.util.resource.IResourceStream,org.apache.wicket.util.watch.IModifiable
public class PackageResourceStream extends org.apache.wicket.util.resource.AbstractResourceStreamAnIResourceStreamthat reads data from a resource in the classpath. It simply delegates all operations to theIResourceStreamreturned by the application'sIResourceStreamLocator.- Author:
- Jean-Baptiste Quenot, Tobias Soloschenko
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PackageResourceStream(java.lang.Class<?> scope, java.lang.String path)Obtains anIResourceStreamfrom the application'sIResourceStreamLocator.locate(Class, String)PackageResourceStream(java.lang.Class<?> scope, java.lang.String path, java.util.Locale locale, java.lang.String style, java.lang.String variation)Obtains anIResourceStreamfrom the application'sIResourceStreamLocator.locate(Class, String)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.StringgetContentType()java.io.InputStreamgetInputStream()org.apache.wicket.util.time.TimelastModifiedTime()org.apache.wicket.util.lang.Byteslength()
-
-
-
Constructor Detail
-
PackageResourceStream
public PackageResourceStream(java.lang.Class<?> scope, java.lang.String path)Obtains anIResourceStreamfrom the application'sIResourceStreamLocator.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
-
PackageResourceStream
public PackageResourceStream(java.lang.Class<?> scope, java.lang.String path, java.util.Locale locale, java.lang.String style, java.lang.String variation)Obtains anIResourceStreamfrom the application'sIResourceStreamLocator.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 resourcelocale- the locale of the resource to getstyle- the style of the resource to getvariation- the variation of the resource to get
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceorg.apache.wicket.util.resource.IResourceStream- Overrides:
getContentTypein classorg.apache.wicket.util.resource.AbstractResourceStream
-
getInputStream
public java.io.InputStream getInputStream() throws org.apache.wicket.util.resource.ResourceStreamNotFoundException- Throws:
org.apache.wicket.util.resource.ResourceStreamNotFoundException
-
length
public org.apache.wicket.util.lang.Bytes length()
- Specified by:
lengthin interfaceorg.apache.wicket.util.resource.IResourceStream- Overrides:
lengthin classorg.apache.wicket.util.resource.AbstractResourceStream
-
lastModifiedTime
public org.apache.wicket.util.time.Time lastModifiedTime()
- Specified by:
lastModifiedTimein interfaceorg.apache.wicket.util.watch.IModifiable- Overrides:
lastModifiedTimein classorg.apache.wicket.util.resource.AbstractResourceStream
-
-