Package nl.vpro.util
Class HttpConnectionUtils
java.lang.Object
nl.vpro.util.HttpConnectionUtils
- Since:
- 1.74
- Author:
- Michiel Meeuwissen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Long
Executes a HEAD request to determine the bytes size of given URL.static OptionalLong
getOptionalByteSize
(String locationUrl) Executes a HEAD request to determine the bytes size of given URL.static <R> R
headRequest
(String locationUrl, BiFunction<HttpResponse<Void>, Exception, R> consumer)
-
Field Details
-
ENABLED
-
-
Method Details
-
getOptionalByteSize
Executes a HEAD request to determine the bytes size of given URL. For mp3's and such.- Returns:
- an optional with the size in bytes of the resource represented by the given url.
- Since:
- 4.1
-
headRequest
public static <R> R headRequest(String locationUrl, BiFunction<HttpResponse<Void>, Exception, R> consumer) -
getByteSize
Executes a HEAD request to determine the bytes size of given URL. For mp3's and such.- Returns:
- the size in bytes, or
null
if it could not be determined. - See Also:
-