Class 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.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, Tobias Soloschenko
    See Also:
    Serialized Form
    • Constructor Detail

      • PackageResourceStream

        public PackageResourceStream​(java.lang.Class<?> scope,
                                     java.lang.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
      • PackageResourceStream

        public PackageResourceStream​(java.lang.Class<?> scope,
                                     java.lang.String path,
                                     java.util.Locale locale,
                                     java.lang.String style,
                                     java.lang.String variation)
        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
        locale - the locale of the resource to get
        style - the style of the resource to get
        variation - 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:
        getContentType in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        getContentType in class org.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:
        length in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        length in class org.apache.wicket.util.resource.AbstractResourceStream
      • lastModifiedTime

        public org.apache.wicket.util.time.Time lastModifiedTime()
        Specified by:
        lastModifiedTime in interface org.apache.wicket.util.watch.IModifiable
        Overrides:
        lastModifiedTime in class org.apache.wicket.util.resource.AbstractResourceStream