public static class CacheDirectiveInfo.Expiration extends Object
newAbsolute(Date) and
newRelative(long) to create an
Expiration.
In either case, the server-side clock is used to determine when a CacheDirective expires.
| Modifier and Type | Field and Description |
|---|---|
static long |
MAX_RELATIVE_EXPIRY_MS
The maximum value we accept for a relative expiry.
|
static CacheDirectiveInfo.Expiration |
NEVER
An relative Expiration that never expires.
|
| Modifier and Type | Method and Description |
|---|---|
Date |
getAbsoluteDate() |
long |
getAbsoluteMillis() |
long |
getMillis() |
boolean |
isRelative() |
static CacheDirectiveInfo.Expiration |
newAbsolute(Date date)
Create a new absolute Expiration.
|
static CacheDirectiveInfo.Expiration |
newAbsolute(long ms)
Create a new absolute Expiration.
|
static CacheDirectiveInfo.Expiration |
newRelative(long ms)
Create a new relative Expiration.
|
String |
toString() |
public static final long MAX_RELATIVE_EXPIRY_MS
public static final CacheDirectiveInfo.Expiration NEVER
public static CacheDirectiveInfo.Expiration newRelative(long ms)
Use NEVER to indicate an Expiration that never
expires.
ms - how long until the CacheDirective expires, in millisecondspublic static CacheDirectiveInfo.Expiration newAbsolute(Date date)
Use NEVER to indicate an Expiration that never
expires.
date - when the CacheDirective expirespublic static CacheDirectiveInfo.Expiration newAbsolute(long ms)
Use NEVER to indicate an Expiration that never
expires.
ms - when the CacheDirective expires, in milliseconds since the Unix
epoch.public boolean isRelative()
public long getMillis()
public Date getAbsoluteDate()
Date object. This converts a
relative Expiration into an absolute Date based on the local
clock.public long getAbsoluteMillis()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.