Package restx.http

Examples of restx.http.ETag


    protected static void handleETagFor(RestxRequest req, RestxResponse resp, Iterable<Entry<String, String>> entries) {
        Hasher hasher = Hashing.sha1().newHasher();
        for (Entry<String, String> entry : entries) {
            hasher.putString(entry.getKey(), Charsets.UTF_8).putString(entry.getValue(), Charsets.UTF_8);
        }
        new ETag(hasher.hash().toString(), CacheControl.MUST_REVALIDATE).handleIn(req, resp);
    }
View Full Code Here


        return ETagSampleObject.class;
    }

    @Override
    public ETag provideETagFor(ETagSampleObject entity) {
        return new ETag(Hashing.md5().hashString(entity.getName(), Charsets.UTF_8).toString(),
                new CacheControl(-1, ImmutableList.of("must-revalidate")));
    }
View Full Code Here

TOP

Related Classes of restx.http.ETag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.