Class GlobalArchiveStreamHandler
java.lang.Object
java.net.URLStreamHandler
cloud.piranha.resource.shrinkwrap.GlobalArchiveStreamHandler
public class GlobalArchiveStreamHandler
extends java.net.URLStreamHandler
Stream handler for the
shrinkwrap
protocol (urls starting with
shrinkwrap://
).
This is for URLs that don't have the embedded stream handler, which is for instance the case when resource URLs obtained from Piranha Micro are converted to external string form and used to create a new URL.
- Author:
- Arjan Tijms
-
Constructor Summary
Constructors Constructor Description GlobalArchiveStreamHandler(WebApplication webApplication)
Constructror. -
Method Summary
Modifier and Type Method Description java.net.URLConnection
connect(java.net.URL requestedUrl)
Connect to the URL.java.net.URLConnection
openConnection(java.net.URL requestedUrl)
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
GlobalArchiveStreamHandler
Constructror.- Parameters:
webApplication
- the web application.
-
-
Method Details
-
connect
public java.net.URLConnection connect(java.net.URL requestedUrl)Connect to the URL.- Parameters:
requestedUrl
- the requested URL.- Returns:
- the URL connection.
-
openConnection
public java.net.URLConnection openConnection(java.net.URL requestedUrl) throws java.io.IOException- Specified by:
openConnection
in classjava.net.URLStreamHandler
- Throws:
java.io.IOException
-