Class Handler

java.lang.Object
java.net.URLStreamHandler
org.springframework.boot.loader.jar.Handler

public class Handler extends URLStreamHandler
URLStreamHandler for Spring Boot loader JarFiles.
Since:
1.0.0
Author:
Phillip Webb, Andy Wilkinson
See Also:
  • Constructor Details

    • Handler

      public Handler()
    • Handler

      public Handler(JarFile jarFile)
  • Method Details

    • openConnection

      protected URLConnection openConnection(URL url) throws IOException
      Specified by:
      openConnection in class URLStreamHandler
      Throws:
      IOException
    • parseURL

      protected void parseURL(URL context, String spec, int start, int limit)
      Overrides:
      parseURL in class URLStreamHandler
    • hashCode

      protected int hashCode(URL u)
      Overrides:
      hashCode in class URLStreamHandler
    • sameFile

      protected boolean sameFile(URL u1, URL u2)
      Overrides:
      sameFile in class URLStreamHandler
    • getRootJarFileFromUrl

      public JarFile getRootJarFileFromUrl(URL url) throws IOException
      Throws:
      IOException
    • setUseFastConnectionExceptions

      public static void setUseFastConnectionExceptions(boolean useFastConnectionExceptions)
      Set if a generic static exception can be thrown when a URL cannot be connected. This optimization is used during class loading to save creating lots of exceptions which are then swallowed.
      Parameters:
      useFastConnectionExceptions - if fast connection exceptions can be used.