PiggybackURLConnection for description and examples.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | asset_protocol
The asset URL protocol name |
| public static final String | asset_protocol_prefix
The asset URL protocol prefix |
| public static final String | assets_folder
The optional asset folder name with ending slash |
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static AssetURLContext | |
| public static AssetURLStreamHandler | |
| public static URL | createURL(final String
resource path, with or w/o path, final ClassLoader asset: prefixthe ClassLoader used to resolve the location, see cl)getClassLoader().Create an asset URL, suitable even w/o the registered asset URLStreamHandler. |
| public static URL | |
| public abstract ClassLoader | |
| public String | getImplementedProtocol()
Implements com. |
| public static URLStreamHandler | getRegisteredHandler()
Returns the asset handler previously set via |
| private static URLConnection | |
| public static boolean | Returns: true if successful, otherwise falseRegisters the generic URLStreamHandlerFactory via |
| public URLConnection | resolve(final String path)
Implements com.
This implementation attempts to resolve
|
| public static URLConnection |
| asset_protocol | back to summary |
|---|---|
| public static final String asset_protocol The asset URL protocol name | |
| asset_protocol_prefix | back to summary |
|---|---|
| public static final String asset_protocol_prefix The asset URL protocol prefix | |
| assets_folder | back to summary |
|---|---|
| public static final String assets_folder The optional asset folder name with ending slash
Note that the asset folder is not used on all platforms using the asset protocol
and you should not rely on it, use | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| AssetURLContext | back to summary |
|---|---|
| public AssetURLContext() | |
| create | back to summary |
|---|---|
| public static AssetURLContext create(final ClassLoader cl) | |
| createHandler | back to summary |
|---|---|
| public static AssetURLStreamHandler createHandler(final ClassLoader cl) | |
| createURL | back to summary |
|---|---|
| public static URL createURL(final String path, final ClassLoader cl) throws MalformedURLException Create an asset URL, suitable even w/o the registered asset URLStreamHandler. This is equivalent with:
return new URL(null, path.startsWith("asset:") ? path : "asset:" + path, new AssetURLStreamHandler(cl));
| |
| createURL | back to summary |
|---|---|
| public static URL createURL(final String path) throws MalformedURLException Create an asset URL, suitable only with the registered asset URLStreamHandler. This is equivalent with:
return new URL(path.startsWith("asset:") ? path : "asset:" + path);
| |
| getClassLoader | back to summary |
|---|---|
| public abstract ClassLoader getClassLoader() Returns an asset aware ClassLoader.
The ClassLoader is required to find the asset resource
via it's
It's
For example, on Android, we redirect all | |
| getImplementedProtocol | back to summary |
|---|---|
| public String getImplementedProtocol() Implements com. Doc from com. Returns the specific protocol, constant for this implementation.
| |
| getRegisteredHandler | back to summary |
|---|---|
| public static URLStreamHandler getRegisteredHandler() Returns the asset handler previously set via | |
| open | back to summary |
|---|---|
| private static URLConnection open(final URL url) | |
| registerHandler | back to summary |
|---|---|
| public static boolean registerHandler(final ClassLoader cl) Registers the generic URLStreamHandlerFactory via
| |
| resolve | back to summary |
|---|---|
| public URLConnection resolve(final String path) throws IOException Implements com. Doc from com. Resolving path to a URL sub protocol and return it's open URLConnection
This implementation attempts to resolve
In case of using the ClassLoader (2) and if running on Android,
the
| |
| resolve | back to summary |
|---|---|
| public static URLConnection resolve(String path, final ClassLoader cl) throws IOException | |