Class Handler
- java.lang.Object
- java.net.URLStreamHandler
- org.springframework.boot.loader.jar.Handler
public class Handler extends URLStreamHandler
URLStreamHandler
for Spring Boot loaderJarFile
s.- See Also:
JarFile.registerUrlProtocolHandler()
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JarFile
getRootJarFileFromUrl(URL url)
protected int
hashCode(URL u)
protected URLConnection
openConnection(URL url)
protected void
parseURL(URL context, String spec, int start, int limit)
protected boolean
sameFile(URL u1, URL u2)
static void
setUseFastConnectionExceptions(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:
openConnection
in classURLStreamHandler
- Throws:
IOException
parseURL
protected void parseURL(URL context, String spec, int start, int limit)
- Overrides:
parseURL
in classURLStreamHandler
hashCode
protected int hashCode(URL u)
- Overrides:
hashCode
in classURLStreamHandler
sameFile
protected boolean sameFile(URL u1, URL u2)
- Overrides:
sameFile
in 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.