Package com.jogamp.common.net
Class PiggybackURLConnection<I extends PiggybackURLContext>
java.lang.Object
java.net.URLConnection
com.jogamp.common.net.PiggybackURLConnection<I>
- Direct Known Subclasses:
AssetURLConnection
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
FieldsFields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Resolves the URL viaPiggybackURLContext.resolve(String), seeAssetURLContext.resolve(String)for an example.abstract StringReturns the entry name of the asset.Returns the resolved sub protocol of the asset or null, ie:Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, 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, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
Field Details
-
subUrl
-
subConn
-
context
-
-
Constructor Details
-
PiggybackURLConnection
- Parameters:
url- the specific URL for this instancecontext- the piggyback context, defining state independent code and constants
-
-
Method Details
-
connect
Resolves the URL via
PiggybackURLContext.resolve(String), seeAssetURLContext.resolve(String)for an example.- Specified by:
connectin classURLConnection- Throws:
IOException
-
getInputStream
- Overrides:
getInputStreamin classURLConnection- Throws:
IOException
-
getEntryName
Returns the entry name of the asset.Plain asset:test/lala.txt Resolved asset:jar:file:/data/app/jogamp.test.apk!/assets/test/lala.txt Result test/lala.txt
- Throws:
IOException- is not connected
-
getSubProtocol
Returns the resolved sub protocol of the asset or null, ie: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
- Throws:
IOException- is not connected
-