private Date getDefaultExpirationDate() { return new DateTime(clock.currentTimeMillis()) .plusMinutes(SYNTHESIZE_SPEECH_DEFAULT_EXPIRATION_MINUTES) .toDate(); }
private Date getExpirationDate() { return new DateTime(clock.currentTimeMillis()).plusMinutes(DEFAULT_EXPIRATION_IN_MINUTES).toDate(); }
/** * Generates an expiration date for the presigned url. If user has specified * an expiration date, check if it is in the given limit. */ private long generateExpirationDate(Date expirationDate) { long expirationInSeconds = expirationDate != null ? ((expirationDate .getTime() - clock.currentTimeMillis()) / 1000L) : PRESIGN_URL_MAX_EXPIRATION_SECONDS; if (expirationInSeconds > PRESIGN_URL_MAX_EXPIRATION_SECONDS) { throw new SdkClientException( "Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. " + "The expiration date set on the current request [" + AWS4SignerUtils.formatTimestamp(expirationDate .getTime()) + "] has exceeded this limit."); } return expirationInSeconds; }
/** * Returns the signing date from the request. */ private final long getSigningDate(SignableRequest<?> request) { return SdkClock.Instance.get().currentTimeMillis() - request.getTimeOffset() * 1000L; }
/** * Generates an expiration date for the presigned url. If user has specified * an expiration date, check if it is in the given limit. */ private long generateExpirationDate(Date expirationDate) { long expirationInSeconds = expirationDate != null ? ((expirationDate .getTime() - clock.currentTimeMillis()) / 1000L) : PRESIGN_URL_MAX_EXPIRATION_SECONDS; if (expirationInSeconds > PRESIGN_URL_MAX_EXPIRATION_SECONDS) { throw new SdkClientException( "Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. " + "The expiration date set on the current request [" + AWS4SignerUtils.formatTimestamp(expirationDate .getTime()) + "] has exceeded this limit."); } return expirationInSeconds; }
/** * Returns the signing date from the request. */ private final long getSigningDate(SignableRequest<?> request) { return SdkClock.Instance.get().currentTimeMillis() - request.getTimeOffset() * 1000L; }
private Date getDefaultExpirationDate() { return new DateTime(clock.currentTimeMillis()) .plusMinutes(SYNTHESIZE_SPEECH_DEFAULT_EXPIRATION_MINUTES) .toDate(); }
private Date getExpirationDate() { return new DateTime(clock.currentTimeMillis()).plusMinutes(DEFAULT_EXPIRATION_IN_MINUTES).toDate(); }
/** * Generates an expiration date for the presigned url. If user has specified * an expiration date, check if it is in the given limit. */ private long generateExpirationDate(Date expirationDate) { long expirationInSeconds = expirationDate != null ? ((expirationDate .getTime() - clock.currentTimeMillis()) / 1000L) : PRESIGN_URL_MAX_EXPIRATION_SECONDS; if (expirationInSeconds > PRESIGN_URL_MAX_EXPIRATION_SECONDS) { throw new SdkClientException( "Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. " + "The expiration date set on the current request [" + AWS4SignerUtils.formatTimestamp(expirationDate .getTime()) + "] has exceeded this limit."); } return expirationInSeconds; }
/** * Returns the signing date from the request. */ private final long getSigningDate(SignableRequest<?> request) { return SdkClock.Instance.get().currentTimeMillis() - request.getTimeOffset() * 1000L; }