Class URLContent

  • All Implemented Interfaces:
    Content

    public class URLContent
    extends AbstractContent
    Content stored at a URL.
    • Constructor Detail

      • URLContent

        public URLContent​(java.net.URL content)
                   throws java.net.URISyntaxException
        Create a new URLContent object.
        Parameters:
        content - the content available at a URL.
        Throws:
        java.net.URISyntaxException - on URI error
      • URLContent

        public URLContent​(FileContent fc)
                   throws java.net.MalformedURLException
        Create a new URLContent object from a FileContent.
        Parameters:
        fc - the file content.
        Throws:
        java.net.MalformedURLException - if URL error
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from interface: Content
        The content bytes as a stream.
        Returns:
        an InputStream for the wrapped content.
        Throws:
        java.io.IOException - on IO error
      • getURL

        public java.net.URL getURL()
        Returns:
        the wrapped url.
      • close

        public void close()
        Free any resources associated with this content.