GlueGen: src/java/com/jogamp/common/net/AssetURLStreamHandler.java Source File

GlueGen v2.6.0-rc-20250722 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 */
22 public class AssetURLStreamHandler extends URLStreamHandler {
23 AssetURLContext ctx;
24
25 public AssetURLStreamHandler(final AssetURLContext ctx) {
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}
com.jogamp.common.net.AssetURLConnection
See base class PiggybackURLConnection for motivation.
Definition: AssetURLConnection.java:72
com.jogamp.common.net.AssetURLContext
See PiggybackURLConnection for description and examples.
Definition: AssetURLContext.java:18
com.jogamp.common.net.AssetURLStreamHandler
URLStreamHandler to handle the asset protocol.
Definition: AssetURLStreamHandler.java:22
com.jogamp.common.net.AssetURLStreamHandler.AssetURLStreamHandler
AssetURLStreamHandler(final AssetURLContext ctx)
Definition: AssetURLStreamHandler.java:25
com.jogamp.common.net.AssetURLStreamHandler.openConnection
URLConnection openConnection(final URL u)
Definition: AssetURLStreamHandler.java:30
com.jogamp.common.net.PiggybackURLConnection.connect
synchronized void connect()
Definition: PiggybackURLConnection.java:41