public class OkHttp3Connection extends Object implements com.liulishuo.filedownloader.connection.FileDownloadConnection
| Modifier and Type | Class and Description |
|---|---|
static class |
OkHttp3Connection.Creator
The creator for the connection implemented with the okhttp3.
|
| Constructor and Description |
|---|
OkHttp3Connection(String url,
okhttp3.OkHttpClient client) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
String value) |
boolean |
dispatchAddResumeOffset(String etag,
long offset) |
void |
ending() |
void |
execute() |
InputStream |
getInputStream() |
Map<String,List<String>> |
getRequestHeaderFields() |
int |
getResponseCode() |
String |
getResponseHeaderField(String name) |
Map<String,List<String>> |
getResponseHeaderFields() |
public OkHttp3Connection(String url, okhttp3.OkHttpClient client)
public void addHeader(String name, String value)
addHeader in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionpublic boolean dispatchAddResumeOffset(String etag, long offset)
dispatchAddResumeOffset in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionpublic InputStream getInputStream() throws IOException
getInputStream in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionIOExceptionpublic Map<String,List<String>> getRequestHeaderFields()
getRequestHeaderFields in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionpublic Map<String,List<String>> getResponseHeaderFields()
getResponseHeaderFields in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionpublic String getResponseHeaderField(String name)
getResponseHeaderField in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionpublic void execute()
throws IOException
execute in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionIOExceptionpublic int getResponseCode()
throws IOException
getResponseCode in interface com.liulishuo.filedownloader.connection.FileDownloadConnectionIOExceptionpublic void ending()
ending in interface com.liulishuo.filedownloader.connection.FileDownloadConnection