Clean up okhttp extension Javadoc

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136702598
This commit is contained in:
olly 2016-10-20 05:04:12 -07:00 committed by Oliver Woodman
parent e4bafd964d
commit 0cff74dc70
2 changed files with 26 additions and 11 deletions

View file

@ -65,7 +65,8 @@ public class OkHttpDataSource implements HttpDataSource {
private long bytesRead;
/**
* @param callFactory A {@link Call.Factory} for use by the source.
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
* by the source.
* @param userAgent The User-Agent string that should be used.
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
* predicate then a InvalidContentTypeException} is thrown from {@link #open(DataSpec)}.
@ -76,7 +77,8 @@ public class OkHttpDataSource implements HttpDataSource {
}
/**
* @param callFactory A {@link Call.Factory} for use by the source.
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
* by the source.
* @param userAgent The User-Agent string that should be used.
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
* predicate then a {@link InvalidContentTypeException} is thrown from
@ -89,14 +91,14 @@ public class OkHttpDataSource implements HttpDataSource {
}
/**
* @param callFactory An {@link Call.Factory} for use by the source.
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
* by the source.
* @param userAgent The User-Agent string that should be used.
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
* predicate then a {@link InvalidContentTypeException} is thrown from
* {@link #open(DataSpec)}.
* @param listener An optional listener.
* @param cacheControl An optional {@link CacheControl} which sets all requests' Cache-Control
* header. For example, you could force the network response for all requests.
* @param cacheControl An optional {@link CacheControl} for setting the Cache-Control header.
*/
public OkHttpDataSource(Call.Factory callFactory, String userAgent,
Predicate<String> contentTypePredicate, TransferListener<? super OkHttpDataSource> listener,

View file

@ -28,25 +28,38 @@ public final class OkHttpDataSourceFactory implements Factory {
private final Call.Factory callFactory;
private final String userAgent;
private final TransferListener<? super DataSource> transferListener;
private final TransferListener<? super DataSource> listener;
private final CacheControl cacheControl;
/**
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
* by the sources created by the factory.
* @param userAgent The User-Agent string that should be used.
* @param listener An optional listener.
*/
public OkHttpDataSourceFactory(Call.Factory callFactory, String userAgent,
TransferListener<? super DataSource> transferListener) {
this(callFactory, userAgent, transferListener, null);
TransferListener<? super DataSource> listener) {
this(callFactory, userAgent, listener, null);
}
/**
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
* by the sources created by the factory.
* @param userAgent The User-Agent string that should be used.
* @param listener An optional listener.
* @param cacheControl An optional {@link CacheControl} for setting the Cache-Control header.
*/
public OkHttpDataSourceFactory(Call.Factory callFactory, String userAgent,
TransferListener<? super DataSource> transferListener, CacheControl cacheControl) {
TransferListener<? super DataSource> listener, CacheControl cacheControl) {
this.callFactory = callFactory;
this.userAgent = userAgent;
this.transferListener = transferListener;
this.listener = listener;
this.cacheControl = cacheControl;
}
@Override
public OkHttpDataSource createDataSource() {
return new OkHttpDataSource(callFactory, userAgent, null, transferListener, cacheControl);
return new OkHttpDataSource(callFactory, userAgent, null, listener, cacheControl);
}
}