Class PackageResourceStream
- java.lang.Object
-
- org.apache.wicket.util.resource.AbstractResourceStream
-
- org.apache.wicket.core.util.resource.PackageResourceStream
-
- All Implemented Interfaces:
Closeable
,Serializable
,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.AbstractResourceStream
AnIResourceStream
that reads data from a resource in the classpath. It simply delegates all operations to theIResourceStream
returned by the application'sIResourceStreamLocator
.- Author:
- Jean-Baptiste Quenot, Tobias Soloschenko
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PackageResourceStream(Class<?> scope, String path)
Obtains anIResourceStream
from the application'sIResourceStreamLocator.locate(Class, String)
PackageResourceStream(Class<?> scope, String path, Locale locale, String style, String variation)
Obtains anIResourceStream
from the application'sIResourceStreamLocator.locate(Class, String)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
String
getContentType()
InputStream
getInputStream()
Instant
lastModifiedTime()
org.apache.wicket.util.lang.Bytes
length()
-
-
-
Constructor Detail
-
PackageResourceStream
public PackageResourceStream(Class<?> scope, String path)
Obtains anIResourceStream
from 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(Class<?> scope, String path, Locale locale, String style, String variation)
Obtains anIResourceStream
from 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 IOException
- Throws:
IOException
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceorg.apache.wicket.util.resource.IResourceStream
- Overrides:
getContentType
in classorg.apache.wicket.util.resource.AbstractResourceStream
-
getInputStream
public 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:
length
in interfaceorg.apache.wicket.util.resource.IResourceStream
- Overrides:
length
in classorg.apache.wicket.util.resource.AbstractResourceStream
-
lastModifiedTime
public Instant lastModifiedTime()
- Specified by:
lastModifiedTime
in interfaceorg.apache.wicket.util.watch.IModifiable
- Overrides:
lastModifiedTime
in classorg.apache.wicket.util.resource.AbstractResourceStream
-
-