jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext > Class Template Referenceabstract

Generic resource location protocol connection, using another sub-protocol as the vehicle for a piggyback protocol. More...

Inheritance diagram for org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >:
Collaboration diagram for org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >:

Public Member Functions

synchronized void connect () throws IOException
 
InputStream getInputStream () throws IOException
 
abstract String getEntryName () throws IOException
 Returns the entry name of the asset. More...
 
URL getSubProtocol () throws IOException
 Returns the resolved sub protocol of the asset or null, ie: More...
 

Protected Member Functions

 PiggybackURLConnection (final URL url, final I context)
 

Protected Attributes

URL subUrl
 
URLConnection subConn
 
context
 

Detailed Description

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.

Definition at line 43 of file PiggybackURLConnection.java.

Constructor & Destructor Documentation

◆ PiggybackURLConnection()

org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.PiggybackURLConnection ( final URL  url,
final I  context 
)
protected
Parameters
urlthe specific URL for this instance
contextthe piggyback context, defining state independent code and constants

Definition at line 52 of file PiggybackURLConnection.java.

Member Function Documentation

◆ connect()

synchronized void org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.connect ( ) throws IOException

Resolves the URL via PiggybackURLContext#resolve(String), see AssetURLContext#resolve(String) for an example.

Definition at line 66 of file PiggybackURLConnection.java.

Here is the caller graph for this function:

◆ getEntryName()

abstract String org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.getEntryName ( ) throws IOException
abstract

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
Exceptions
IOExceptionis not connected

◆ getInputStream()

InputStream org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.getInputStream ( ) throws IOException

Definition at line 75 of file PiggybackURLConnection.java.

◆ getSubProtocol()

URL org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.getSubProtocol ( ) throws IOException

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
Exceptions
IOExceptionis not connected

Definition at line 103 of file PiggybackURLConnection.java.

Member Data Documentation

◆ context

I org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.context
protected

Definition at line 46 of file PiggybackURLConnection.java.

◆ subConn

URLConnection org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.subConn
protected

Definition at line 45 of file PiggybackURLConnection.java.

◆ subUrl

URL org.jau.net.PiggybackURLConnection< I extends PiggybackURLContext >.subUrl
protected

Definition at line 44 of file PiggybackURLConnection.java.


The documentation for this class was generated from the following file: