GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
Handler.java
Go to the documentation of this file.
1package com.jogamp.common.net.asset;
2
3import java.io.IOException;
4import java.net.URL;
5import java.net.URLConnection;
6import java.net.URLStreamHandler;
7
8import com.jogamp.common.net.AssetURLConnection;
9import com.jogamp.common.net.AssetURLContext;
10
11/**
12 * {@link URLStreamHandler} to handle the asset protocol.
13 *
14 * <p>
15 * This is the <i>asset</i> URLStreamHandler variation
16 * using this class ClassLoader for the pkg factory model.
17 * </p>
18 */
19public class Handler extends URLStreamHandler {
20 static final AssetURLContext localCL = new AssetURLContext() {
21 @Override
22 public ClassLoader getClassLoader() {
23 return Handler.class.getClassLoader();
24 }
25 };
26
27 public Handler() {
28 super();
29 }
30
31 @Override
32 protected URLConnection openConnection(final URL u) throws IOException {
33 final AssetURLConnection c = new AssetURLConnection(u, localCL);
34 c.connect();
35 return c;
36 }
37
38}
See base class PiggybackURLConnection for motivation.
See PiggybackURLConnection for description and examples.
URLStreamHandler to handle the asset protocol.
Definition: Handler.java:19
URLConnection openConnection(final URL u)
Definition: Handler.java:32