Package nl.vpro.util

Class HttpConnectionUtils

java.lang.Object
nl.vpro.util.HttpConnectionUtils

public class HttpConnectionUtils extends Object
Since:
1.74
Author:
Michiel Meeuwissen
  • Field Details

  • Method Details

    • getOptionalByteSize

      public static OptionalLong getOptionalByteSize(String locationUrl)
      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

      public static Long getByteSize(String u)
      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: