Package echo.util

Class UrlWrapper


  • class UrlWrapper
    extends java.lang.Object
    Wraps the java URL class so that it exposes methods to determine if entered values are urls or not.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String spec  
    • Constructor Summary

      Constructors 
      Constructor Description
      UrlWrapper​(java.lang.String spec)
      Creates a new UrlWrapper with a supplied url
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isUrl()
      Returns true if the specified string is a URL
      java.io.InputStream openStream()
      Open an input stream to the location of the url
      • Methods inherited from class java.lang.Object

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

      • spec

        private final java.lang.String spec
    • Constructor Detail

      • UrlWrapper

        public UrlWrapper​(java.lang.String spec)
        Creates a new UrlWrapper with a supplied url
    • Method Detail

      • isUrl

        public boolean isUrl()
        Returns true if the specified string is a URL
      • openStream

        public java.io.InputStream openStream()
                                       throws java.io.IOException
        Open an input stream to the location of the url
        Throws:
        java.io.IOException