Class UrlResourceStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Serializable, java.lang.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 Summary

      Constructors 
      Constructor Description
      UrlResourceStream​(java.net.URL url)
      Construct.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this resource.
      java.lang.String getContentType()  
      java.io.InputStream getInputStream()  
      java.net.URL getURL()  
      org.apache.wicket.util.time.Time lastModifiedTime()  
      org.apache.wicket.util.lang.Bytes length()  
      java.lang.String locationAsString()  
      java.lang.String toString()  
      • 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, wait, wait, wait
    • Constructor Detail

      • UrlResourceStream

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

      • close

        public void close()
                   throws java.io.IOException
        Closes this resource.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface org.apache.wicket.util.resource.IResourceStream
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.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 java.net.URL getURL()
        Returns:
        The URL to this resource (if any)
      • 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
        Returns:
        The last time this resource was modified
        See Also:
        IModifiable.lastModifiedTime()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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
        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 java.lang.String locationAsString()
        Specified by:
        locationAsString in interface org.apache.wicket.util.resource.IFixedLocationResourceStream