public abstract class PiggybackURLConnection<I extends PiggybackURLContext> extends URLConnection
The details of the sub-protocol can be queried using getSubProtocol()
.
See example in AssetURLConnection
.
Modifier and Type | Field and Description |
---|---|
protected I |
context |
protected URLConnection |
subConn |
protected URL |
subUrl |
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
Modifier | Constructor and Description |
---|---|
protected |
PiggybackURLConnection(URL url,
I context) |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Resolves the URL via
PiggybackURLContext.resolve(String) ,
see AssetURLContext.resolve(String) for an example. |
abstract String |
getEntryName()
Returns the entry name of the asset.
|
InputStream |
getInputStream() |
URL |
getSubProtocol()
Returns the resolved sub protocol of the asset or null, ie:
|
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
protected URL subUrl
protected URLConnection subConn
protected I extends PiggybackURLContext context
public void connect() throws IOException
Resolves the URL via PiggybackURLContext.resolve(String)
,
see AssetURLContext.resolve(String)
for an example.
connect
in class URLConnection
IOException
public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
IOException
public abstract String getEntryName() throws IOException
Plain asset:test/lala.txt Resolved asset:jar:file:/data/app/jogamp.test.apk!/assets/test/lala.txt Result test/lala.txt
IOException
- is not connectedpublic URL getSubProtocol() throws IOException
Plain asset:test/lala.txt Resolved asset:jar:file:/data/app/jogamp.test.apk!/assets/test/lala.txt Result jar:file:/data/app/jogamp.test.apk!/assets/test/lala.txt
IOException
- is not connected