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