public class OkHttpDownloader extends Downloader
Constructor and Description |
---|
OkHttpDownloader(Context context) |
Modifier and Type | Method and Description |
---|---|
boolean |
clearCache()
Clears the
Downloader cache. |
java.lang.String |
execute(Request request)
Executes the specified request and returns the response String.
|
java.lang.String |
toSafeUrl(Request request)
Parses a request into a safe URL to be used for caching/tracking purposes.
|
java.lang.String |
toUrl(Request request)
Parses a request into a URL to be used for execution.
|
attachInstance
public boolean clearCache()
Downloader
Downloader
cache.clearCache
in class Downloader
true
if successful, false
if otherwise.public java.lang.String execute(Request request) throws java.lang.IllegalArgumentException, java.io.IOException
Downloader
execute
in class Downloader
request
- PkRSS Request object containing all necessary parameters.java.lang.IllegalArgumentException
java.io.IOException
public java.lang.String toSafeUrl(Request request)
Downloader
Note: Returning an invalid URL may cause caching errors and mishandled memory.
toSafeUrl
in class Downloader
request
- PkRSS Request object containing all necessary parameters.public java.lang.String toUrl(Request request)
Downloader
toUrl
in class Downloader
request
- PkRSS Request object containing all necessary parameters.