Class Handler
- java.lang.Object
- java.net.URLStreamHandler
- org.springframework.boot.loader.jar.Handler
public class Handler extends URLStreamHandler
URLStreamHandlerfor Spring Boot loaderJarFiles.- See Also:
JarFile.registerUrlProtocolHandler()
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JarFilegetRootJarFileFromUrl(URL url)protected inthashCode(URL u)protected URLConnectionopenConnection(URL url)protected voidparseURL(URL context, String spec, int start, int limit)protected booleansameFile(URL u1, URL u2)static voidsetUseFastConnectionExceptions(boolean useFastConnectionExceptions)Set if a generic static exception can be thrown when a URL cannot be connected.Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hostsEqual, openConnection, setURL, setURL, toExternalForm
Method Detail
openConnection
protected URLConnection openConnection(URL url) throws IOException
- Specified by:
openConnectionin classURLStreamHandler- Throws:
IOException
parseURL
protected void parseURL(URL context, String spec, int start, int limit)
- Overrides:
parseURLin classURLStreamHandler
hashCode
protected int hashCode(URL u)
- Overrides:
hashCodein classURLStreamHandler
sameFile
protected boolean sameFile(URL u1, URL u2)
- Overrides:
sameFilein classURLStreamHandler
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.