Class Connections


  • public class Connections
    extends java.lang.Object
    URLConnection related utilities
    Author:
    igor.vaynberg
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void close​(java.net.URLConnection connection)
      Closes a connection
      static void closeQuietly​(java.net.URLConnection connection)
      Closes a connection, ignoring any exceptions if they occur
      static Time getLastModified​(java.net.URL url)
      Gets last modified date of the given URL
      • Methods inherited from class java.lang.Object

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

      • getLastModified

        public static Time getLastModified​(java.net.URL url)
                                    throws java.io.IOException
        Gets last modified date of the given URL
        Parameters:
        url -
        Returns:
        last modified timestamp or null if not available
        Throws:
        java.io.IOException
      • closeQuietly

        public static void closeQuietly​(java.net.URLConnection connection)
        Closes a connection, ignoring any exceptions if they occur
        Parameters:
        connection -
      • close

        public static void close​(java.net.URLConnection connection)
                          throws java.io.IOException
        Closes a connection
        Parameters:
        connection -
        Throws:
        java.io.IOException