Package com.sprylab.xar
Class HttpXarSource
- java.lang.Object
-
- com.sprylab.xar.XarSource
-
- com.sprylab.xar.HttpXarSource
-
public class HttpXarSource extends XarSource
Represents an eXtensible ARchiver using a URL.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.sprylab.xar.XarSource
XarSource.OnEntryExtractedListener
-
-
Field Summary
-
Fields inherited from class com.sprylab.xar.XarSource
customParser
-
-
Constructor Summary
Constructors Constructor Description HttpXarSource(String url)Create a newXarSourcefrom aurl.HttpXarSource(String url, okhttp3.OkHttpClient okHttpClient)Create a newXarSourcefrom aurl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okio.BufferedSourcegetRange(long offset, long length)longgetSize()StringgetUrl()StringtoString()-
Methods inherited from class com.sprylab.xar.XarSource
extractAll, extractAll, extractAll, getEntries, getEntry, getHeader, getToc, getToCSource, getToCStream, hasEntry
-
-
-
-
Constructor Detail
-
HttpXarSource
public HttpXarSource(String url)
- Parameters:
url- the URL referencing the archive file
-
HttpXarSource
public HttpXarSource(String url, okhttp3.OkHttpClient okHttpClient)
Create a newXarSourcefrom aurl. It is recommended to create and manage a global, sharedOkHttpClientinstance for optimal overall performance. IfokHttpClientisnull, a default, non-sharedOkHttpClientis used.- Parameters:
url- the URL referencing the archive fileokHttpClient- theOkHttpClientto use ornullto use the default one
-
-
Method Detail
-
getRange
public okio.BufferedSource getRange(long offset, long length) throws IOException- Specified by:
getRangein classXarSource- Throws:
IOException
-
getSize
public long getSize() throws XarException- Specified by:
getSizein classXarSource- Throws:
XarException
-
getUrl
public String getUrl()
- Returns:
- the underlying URL
-
-