@Override public ServletInputStream getInputStream() throws IOException { if (cachedBytes == null) { cacheInputStream(); } return new CachedServletInputStream(); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, boolean noProxy) { setCachingHeaders(response, defaultTtl, noProxy); }
public void cleanup() { for (CleanupCapable cleanupHandler : cleanupHandlers) { cleanupHandler.cleanup(); } } }
@Test public void testNoRequestGetsNull() { HttpServletUserAgentProvider provider = new HttpServletUserAgentProvider( parser, new HttpServletRequestProvider(null)); assertNull(provider.get()); }
public void setCachingHeaders(HttpServletResponse resp, int ttl, boolean noProxy) { if (ttl < 0) { HttpUtil.setCachingHeaders(resp, noProxy); } else if (ttl == 0) { HttpUtil.setNoCache(resp); } else { HttpUtil.setCachingHeaders(resp, ttl, noProxy); } } }
@Test public void testNoRequestGetsNull() { HttpServletUserAgentProvider provider = new HttpServletUserAgentProvider( parser, new HttpServletRequestProvider(null)); assertNull(provider.get()); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, boolean noProxy) { setCachingHeaders(response, defaultTtl, noProxy); }
@Test public void testNoRequestGetsNull() { HttpServletUserAgentProvider provider = new HttpServletUserAgentProvider( parser, new HttpServletRequestProvider(null)); assertNull(provider.get()); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. */ public static void setCachingHeaders(HttpServletResponse response, int ttl) { setCachingHeaders(response, ttl, false); }
@Test public void testNoRequestGetsNull() { HttpServletUserAgentProvider provider = new HttpServletUserAgentProvider( parser, new HttpServletRequestProvider(null)); assertNull(provider.get()); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, boolean noProxy) { setCachingHeaders(response, defaultTtl, noProxy); }
@Test public void testNoRequestGetsNull() { HttpServletUserAgentProvider provider = new HttpServletUserAgentProvider( parser, new HttpServletRequestProvider(null)); assertNull(provider.get()); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response */ public static void setCachingHeaders(HttpServletResponse response) { setCachingHeaders(response, defaultTtl, false); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, boolean noProxy) { setCachingHeaders(response, defaultTtl, noProxy); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. */ public static void setCachingHeaders(HttpServletResponse response, int ttl) { setCachingHeaders(response, ttl, false); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. */ public static void setCachingHeaders(HttpServletResponse response, int ttl) { setCachingHeaders(response, ttl, false); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response */ public static void setCachingHeaders(HttpServletResponse response) { setCachingHeaders(response, defaultTtl, false); }