Class ConfigurationSource.Resource

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Enclosing interface:
    ConfigurationSource

    public static class ConfigurationSource.Resource
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Represents a resource: a stream to the resource associated with its URI.
    • Constructor Summary

      Constructors 
      Constructor Description
      Resource​(java.io.InputStream inputStream, java.net.URI uri)
      Creates a new resource with the given input stream and URI.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.io.InputStream getInputStream()
      Returns the input stream for reading the resource content.
      long getLastModified()
      Returns the last modified time of the resource in milliseconds since the epoch.
      java.net.URI getURI()
      Returns the URI that identifies the resource location.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Resource

        public Resource​(java.io.InputStream inputStream,
                        java.net.URI uri)
        Creates a new resource with the given input stream and URI.
        Parameters:
        inputStream - the input stream for the resource content
        uri - the URI identifying the resource location
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
        Returns the input stream for reading the resource content.
        Returns:
        the input stream
      • getURI

        public java.net.URI getURI()
        Returns the URI that identifies the resource location.
        Returns:
        the resource URI
      • getLastModified

        public long getLastModified()
                             throws java.net.MalformedURLException,
                                    java.io.IOException
        Returns the last modified time of the resource in milliseconds since the epoch.
        Returns:
        the last modified time in milliseconds
        Throws:
        java.net.MalformedURLException - if the resource URI cannot be converted to a URL
        java.io.IOException - if an I/O error occurs while fetching the last modified time
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException