APISonar


org.takes.misc.Expires.Expires.Date

> org > takes > misc > Expires > Expires > Date
org APIs takes APIs misc APIs Expires APIs Expires APIs Date APIs

Example 1
public RsFlash(final CharSequence msg, final Level level,
        final String cookie) throws UnsupportedEncodingException {
        this(
            msg,
            level,
            cookie,
            new Expires.Date(
                System.currentTimeMillis()
                + TimeUnit.HOURS.toMillis(1L)
            )
        );
    }
Example 2
public RsPrevious(final Response rsp, final String location)
        throws UnsupportedEncodingException {
        super(
            new RsWithCookie(
                rsp,
                TkPrevious.class.getSimpleName(),
                URLEncoder.encode(location, "UTF-8"),
                "Path=/",
                new Expires.Date(
                    System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1L)
                ).print()
            )
        );
    }
Example 3
public void addsCookieWithSpecifiedExpiresToResponse() throws IOException {
        new Assertion<>(
            "Response must contain a flash cookie with an expiration date.",
            new RsPrint(
                new RsFlash("i'm good, thanks", new Expires.Date(0L))
            ),
            new TextHasString("Expires=Thu, 01 Jan 1970 00:00:00 GMT")
        ).affirm();
    }