public Timezones.TaggedTimeZone getTz(final String id,
                                        final String etag) throws TimezonesException {
    if (id == null) {
      return null;
    }

    try (CloseableHttpResponse hresp =
      doCall("zones/" + id.replace("/", "%2F"),
             etag,
             null)) {
      if (status == HttpServletResponse.SC_NO_CONTENT) {
        return new Timezones.TaggedTimeZone(etag);
      }

      if (status != HttpServletResponse.SC_OK) {
        return null;
      }

      final String respEtag = HttpUtil.getFirstHeaderValue(hresp, "Etag");
      if (respEtag == null) {
        // Not valid but keep calm and carry on
        return new Timezones.TaggedTimeZone("--No etag--",
                                            EntityUtils.toString(hresp.getEntity()));
      }
      return new Timezones.TaggedTimeZone(respEtag,
                                          EntityUtils.toString(hresp.getEntity()));
    } catch (final TimezonesException cfe) {
      throw cfe;
    } catch (final Throwable t) {
      throw new TimezonesException(t);
    }
  }
public Timezones . TaggedTimeZone getTz ( final String id , final String etag ) throws TimezonesException { if ( id == null ) { return null ; } try ( CloseableHttpResponse hresp = doCall ( "zones/" + id . replace ( "/" , "%2F" ) , etag , null ) ) { if ( status == HttpServletResponse . SC_NO_CONTENT ) { return new Timezones . TaggedTimeZone ( etag ) ; } if ( status != HttpServletResponse . SC_OK ) { return null ; } final String respEtag = HttpUtil . getFirstHeaderValue ( hresp , "Etag" ) ; if ( respEtag == null ) { return new Timezones . TaggedTimeZone ( "--No etag--" , EntityUtils . toString ( hresp . getEntity ( ) ) ) ; } return new Timezones . TaggedTimeZone ( respEtag , EntityUtils . toString ( hresp . getEntity ( ) ) ) ; } catch ( final TimezonesException cfe ) { throw cfe ; } catch ( final Throwable t ) { throw new TimezonesException ( t ) ; } }
@param id the tz id
@param etag from last time
@return fetch timezone if etag is old
@throws TimezonesException on error