} else if ("public".equals(directiveName)) { cacheControl.getCacheExtension().put(directiveName, null); } else if ("no-cache".equals(directiveName)) { cacheControl.setNoCache(true); value = reader.nextTokenOrQuotedString().toString(); cacheControl.getCacheExtension().put(directiveName, value);
} else if ("public".equals(directiveName)) { cacheControl.getCacheExtension().put(directiveName, null); } else if ("no-cache".equals(directiveName)) { cacheControl.setNoCache(true); value = reader.nextTokenOrQuotedString().toString(); cacheControl.getCacheExtension().put(directiveName, value);
for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) { appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue()));
for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) { appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue()));
for (String key : value.getCacheExtension().keySet()) String val = value.getCacheExtension().get(key); addDirective(key, buffer); if (val != null && !"".equals(val))
@Override public int hashCode() { int result = 17; result = 31 * result + maxAge; result = 31 * result + sMaxAge; result = 31 * result + ((isPrivate) ? 1 : 0); result = 31 * result + ((noCache) ? 1 : 0); result = 31 * result + ((noStore) ? 1 : 0); result = 31 * result + ((noTransform) ? 1 : 0); result = 31 * result + ((mustRevalidate) ? 1 : 0); result = 31 * result + ((proxyRevalidate) ? 1 : 0); result = 31 * result + getCacheExtension().hashCode(); result = 31 * result + getNoCacheFields().hashCode(); result = 31 * result + getPrivateFields().hashCode(); return result; }
@Override public CacheControl valueOf(final String str) { if (str == null) { return null; } final CacheControl cacheControl = CacheControl.valueOf(str); // workaround for bug in CacheControl's equals() method cacheControl.getCacheExtension(); cacheControl.getNoCacheFields(); return cacheControl; }
@Override public CacheControl valueOf(final String str) { if (str == null) { return null; } final CacheControl cacheControl = CacheControl.valueOf(str); // workaround for bug in CacheControl's equals() method cacheControl.getCacheExtension(); cacheControl.getNoCacheFields(); return cacheControl; }
} else if ("public".equals(directiveName)) { cacheControl.getCacheExtension().put(directiveName, null); } else if ("no-cache".equals(directiveName)) { cacheControl.setNoCache(true); value = reader.nextTokenOrQuotedString().toString(); cacheControl.getCacheExtension().put(directiveName, value);
} else if (directiveName.equalsIgnoreCase("public")) { cacheControl.getCacheExtension().put(directiveName, null); } else if (directiveName.equalsIgnoreCase("no-cache")) { cacheControl.setNoCache(true); value = reader.nextTokenOrQuotedString(); cacheControl.getCacheExtension().put(directiveName, value);
private static CacheControl createCacheControl() { final CacheControl cacheControl = new CacheControl(); cacheControl.getCacheExtension(); // workaround for bug in // CacheControl's equals() method cacheControl.getNoCacheFields(); // workaround for bug in CacheControl's // equals() method return cacheControl; }
private static CacheControl createCacheControl() { final CacheControl cacheControl = new CacheControl(); cacheControl.getCacheExtension(); // workaround for bug in // CacheControl's equals() method cacheControl.getNoCacheFields(); // workaround for bug in CacheControl's // equals() method return cacheControl; }
private static CacheControl createCacheControl() { final CacheControl cacheControl = new CacheControl(); cacheControl.getCacheExtension(); // workaround for bug in // CacheControl's equals() method cacheControl.getNoCacheFields(); // workaround for bug in CacheControl's // equals() method return cacheControl; }
public CacheControl build() { CacheControl cacheControl = new CacheControl(); cacheControl.setMustRevalidate(mustRevalidate); cacheControl.setProxyRevalidate(proxyRevalidate); cacheControl.setMaxAge(maxAge); cacheControl.setSMaxAge(sMaxAge); cacheControl.setNoCache(noCache); cacheControl.setPrivate(privateFlag); cacheControl.setNoTransform(noTransform); cacheControl.setNoStore(noStore); if (privateFields != null) { cacheControl.getPrivateFields().addAll(privateFields); } if (noCacheFields != null) { cacheControl.getNoCacheFields().addAll(noCacheFields); } if (cacheExtension != null) { cacheControl.getCacheExtension().putAll(cacheExtension); } return cacheControl; } }
appendString(buff, Integer.toString(header.getSMaxAge())); for (Map.Entry<String, String> entry : header.getCacheExtension().entrySet()) { appendWithSingleParameter(buff, entry.getKey(), entry.getValue());
public String toString(CacheControl header) { StringBuffer b = new StringBuffer(); if (header.isPrivate()) appendQuotedWithSeparator(b, "private", buildListValue(header.getPrivateFields())); if (header.isNoCache()) appendQuotedWithSeparator(b, "no-cache", buildListValue(header.getNoCacheFields())); if (header.isNoStore()) appendWithSeparator(b, "no-store"); if (header.isNoTransform()) appendWithSeparator(b, "no-transform"); if (header.isMustRevalidate()) appendWithSeparator(b, "must-revalidate"); if (header.isProxyRevalidate()) appendWithSeparator(b, "proxy-revalidate"); if (header.getMaxAge() != -1) appendWithSeparator(b, "max-age", header.getMaxAge()); if (header.getSMaxAge() != -1) appendWithSeparator(b, "s-maxage", header.getSMaxAge()); for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) { appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue())); } return b.toString(); }
public String toString(CacheControl header) { StringBuffer b = new StringBuffer(); if (header.isPrivate()) appendQuotedWithSeparator(b, "private", buildListValue(header.getPrivateFields())); if (header.isNoCache()) appendQuotedWithSeparator(b, "no-cache", buildListValue(header.getNoCacheFields())); if (header.isNoStore()) appendWithSeparator(b, "no-store"); if (header.isNoTransform()) appendWithSeparator(b, "no-transform"); if (header.isMustRevalidate()) appendWithSeparator(b, "must-revalidate"); if (header.isProxyRevalidate()) appendWithSeparator(b, "proxy-revalidate"); if (header.getMaxAge() != -1) appendWithSeparator(b, "max-age", header.getMaxAge()); if (header.getSMaxAge() != -1) appendWithSeparator(b, "s-maxage", header.getSMaxAge()); for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) { appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue())); } return b.toString(); }
for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) { appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue()));
for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) { appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue()));
/** * @param cacheDirectives * @return the converted JAX-RS {@link CacheControl} */ public static CacheControl toJaxRsCacheControl( List<CacheDirective> cacheDirectives) { CacheControl jaxRsCacheControl = new CacheControl(); for (CacheDirective cacheDirective : cacheDirectives) { if (cacheDirective.getName() == HeaderConstants.CACHE_MAX_AGE) jaxRsCacheControl.setMaxAge(Integer.valueOf(cacheDirective .getValue())); else if (cacheDirective.getName() == HeaderConstants.CACHE_MUST_REVALIDATE) jaxRsCacheControl.setMustRevalidate(true); else if (cacheDirective.getName() == HeaderConstants.CACHE_NO_CACHE) jaxRsCacheControl.setNoCache(true); else if (cacheDirective.getName() == HeaderConstants.CACHE_NO_STORE) jaxRsCacheControl.setNoStore(true); else if (cacheDirective.getName() == HeaderConstants.CACHE_NO_TRANSFORM) jaxRsCacheControl.setNoTransform(true); else if (cacheDirective.getName() == HeaderConstants.CACHE_PROXY_MUST_REVALIDATE) jaxRsCacheControl.setProxyRevalidate(true); else if (cacheDirective.getName() == HeaderConstants.CACHE_PUBLIC) jaxRsCacheControl.setPrivate(false); else jaxRsCacheControl.getCacheExtension().put( cacheDirective.getName(), cacheDirective.getValue()); } return jaxRsCacheControl; }