@VisibleForTesting
  static Duration parseDuration(String durStr) {
    try {
      // try format like '1hr20s'
      return Duration.ofMillis(TimeUtils.convertPeriodToMillis(durStr));
    } catch (Exception ignore) {
    }
    try {
      // try format like 'PT1H20S'
      return Duration.parse(durStr);
    } catch (Exception e) {
      throw new IllegalArgumentException(
          String.format("Invalid time duration '%s', for examples '1hr20s' or 'PT1H20S'", durStr), e);
    }
  }
@Test(expectedExceptions = IllegalArgumentException.class)
  public void testParseDuration() {
    Assert.assertEquals(S3Config.parseDuration("P1DT2H30S"), S3Config.parseDuration("1d2h30s"));
    S3Config.parseDuration("10");
  }