|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.URLConnection
com.jogamp.common.net.PiggybackURLConnection<I>
public abstract class PiggybackURLConnection<I extends PiggybackURLContext>
Generic resource location protocol connection, using another sub-protocol as the vehicle for a piggyback protocol.
The details of the sub-protocol can be queried using getSubProtocol().
See example in AssetURLConnection.
| Field Summary | |
|---|---|
protected I |
context
|
protected URLConnection |
subConn
|
protected URL |
subUrl
|
| Fields inherited from class java.net.URLConnection |
|---|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
| Constructor Summary | |
|---|---|
protected |
PiggybackURLConnection(URL url,
I context)
|
| Method Summary | |
|---|---|
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: |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected URL subUrl
protected URLConnection subConn
protected I extends PiggybackURLContext context
| Constructor Detail |
|---|
protected PiggybackURLConnection(URL url,
I context)
url - the specific URL for this instancecontext - the piggyback context, defining state independent code and constants| Method Detail |
|---|
public void connect()
throws IOException
Resolves the URL via PiggybackURLContext.resolve(String),
see AssetURLContext.resolve(String) for an example.
connect in class URLConnectionIOException
public InputStream getInputStream()
throws IOException
getInputStream in class URLConnectionIOException
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 connected
public 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||