mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Clean up okhttp extension Javadoc
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136702598
This commit is contained in:
parent
e4bafd964d
commit
0cff74dc70
2 changed files with 26 additions and 11 deletions
|
|
@ -65,7 +65,8 @@ public class OkHttpDataSource implements HttpDataSource {
|
||||||
private long bytesRead;
|
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 userAgent The User-Agent string that should be used.
|
||||||
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
||||||
* predicate then a InvalidContentTypeException} is thrown from {@link #open(DataSpec)}.
|
* 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 userAgent The User-Agent string that should be used.
|
||||||
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
||||||
* predicate then a {@link InvalidContentTypeException} is thrown from
|
* 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 userAgent The User-Agent string that should be used.
|
||||||
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
||||||
* predicate then a {@link InvalidContentTypeException} is thrown from
|
* predicate then a {@link InvalidContentTypeException} is thrown from
|
||||||
* {@link #open(DataSpec)}.
|
* {@link #open(DataSpec)}.
|
||||||
* @param listener An optional listener.
|
* @param listener An optional listener.
|
||||||
* @param cacheControl An optional {@link CacheControl} which sets all requests' Cache-Control
|
* @param cacheControl An optional {@link CacheControl} for setting the Cache-Control header.
|
||||||
* header. For example, you could force the network response for all requests.
|
|
||||||
*/
|
*/
|
||||||
public OkHttpDataSource(Call.Factory callFactory, String userAgent,
|
public OkHttpDataSource(Call.Factory callFactory, String userAgent,
|
||||||
Predicate<String> contentTypePredicate, TransferListener<? super OkHttpDataSource> listener,
|
Predicate<String> contentTypePredicate, TransferListener<? super OkHttpDataSource> listener,
|
||||||
|
|
|
||||||
|
|
@ -28,25 +28,38 @@ public final class OkHttpDataSourceFactory implements Factory {
|
||||||
|
|
||||||
private final Call.Factory callFactory;
|
private final Call.Factory callFactory;
|
||||||
private final String userAgent;
|
private final String userAgent;
|
||||||
private final TransferListener<? super DataSource> transferListener;
|
private final TransferListener<? super DataSource> listener;
|
||||||
private final CacheControl cacheControl;
|
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,
|
public OkHttpDataSourceFactory(Call.Factory callFactory, String userAgent,
|
||||||
TransferListener<? super DataSource> transferListener) {
|
TransferListener<? super DataSource> listener) {
|
||||||
this(callFactory, userAgent, transferListener, null);
|
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,
|
public OkHttpDataSourceFactory(Call.Factory callFactory, String userAgent,
|
||||||
TransferListener<? super DataSource> transferListener, CacheControl cacheControl) {
|
TransferListener<? super DataSource> listener, CacheControl cacheControl) {
|
||||||
this.callFactory = callFactory;
|
this.callFactory = callFactory;
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
this.transferListener = transferListener;
|
this.listener = listener;
|
||||||
this.cacheControl = cacheControl;
|
this.cacheControl = cacheControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OkHttpDataSource createDataSource() {
|
public OkHttpDataSource createDataSource() {
|
||||||
return new OkHttpDataSource(callFactory, userAgent, null, transferListener, cacheControl);
|
return new OkHttpDataSource(callFactory, userAgent, null, listener, cacheControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue