Class UrlResourceStream

  • All Implemented Interfaces:
    Closeable, Serializable, AutoCloseable, org.apache.wicket.util.io.IClusterable, org.apache.wicket.util.resource.IFixedLocationResourceStream, org.apache.wicket.util.resource.IResourceStream, org.apache.wicket.util.watch.IModifiable

    public class UrlResourceStream
    extends org.apache.wicket.util.resource.AbstractResourceStream
    implements org.apache.wicket.util.resource.IFixedLocationResourceStream
    UrlResourceStream implements IResource for URLs.
    Author:
    Jonathan Locke, Igor Vaynberg
    See Also:
    IResourceStream, IModifiable, Serialized Form
    • Constructor Detail

      • UrlResourceStream

        public UrlResourceStream​(URL url)
        Construct.
        Parameters:
        url - URL of resource
    • Method Detail

      • getInputStream

        public InputStream getInputStream()
                                   throws org.apache.wicket.util.resource.ResourceStreamNotFoundException
        Specified by:
        getInputStream in interface org.apache.wicket.util.resource.IResourceStream
        Returns:
        A readable input stream for this resource.
        Throws:
        org.apache.wicket.util.resource.ResourceStreamNotFoundException
      • getURL

        public URL getURL()
        Returns:
        The URL to this resource (if any)
      • lastModifiedTime

        public Instant lastModifiedTime()
        Specified by:
        lastModifiedTime in interface org.apache.wicket.util.watch.IModifiable
        Overrides:
        lastModifiedTime in class org.apache.wicket.util.resource.AbstractResourceStream
        Returns:
        The last time this resource was modified
        See Also:
        IModifiable.lastModifiedTime()
      • getContentType

        public String getContentType()
        Specified by:
        getContentType in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        getContentType in class org.apache.wicket.util.resource.AbstractResourceStream
        Returns:
        The content type of this resource, such as "image/jpeg" or "text/html"
      • 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
      • locationAsString

        public String locationAsString()
        Specified by:
        locationAsString in interface org.apache.wicket.util.resource.IFixedLocationResourceStream