From 0cff74dc704fa1d7fa6fd7d969398e7831384c24 Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 20 Oct 2016 05:04:12 -0700 Subject: [PATCH] Clean up okhttp extension Javadoc ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136702598 --- .../ext/okhttp/OkHttpDataSource.java | 12 +++++---- .../ext/okhttp/OkHttpDataSourceFactory.java | 25 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java b/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java index e56072f368..8577d33781 100644 --- a/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java +++ b/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java @@ -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 contentTypePredicate, TransferListener listener, diff --git a/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSourceFactory.java b/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSourceFactory.java index a4dd10a8d3..33f204a6f3 100644 --- a/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSourceFactory.java +++ b/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSourceFactory.java @@ -28,25 +28,38 @@ public final class OkHttpDataSourceFactory implements Factory { private final Call.Factory callFactory; private final String userAgent; - private final TransferListener transferListener; + private final TransferListener 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 transferListener) { - this(callFactory, userAgent, transferListener, null); + TransferListener 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 transferListener, CacheControl cacheControl) { + TransferListener 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); } }