@Override public Date getLastModified() { return underlying.getLastModified(); }
final Date lastModified = resource.getLastModified(); if (!ETagUtils.handleIfMatch(exchange, etag, false) || !DateUtils.handleIfUnmodifiedSince(exchange, lastModified)) { rangeResponse = range.getResponseResult(resource.getContentLength(), exchange.getRequestHeaders().getFirst(Headers.IF_RANGE), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart();
private void serveFileBlocking(final HttpServletRequest req, final HttpServletResponse resp, final Resource resource, HttpServerExchange exchange) throws IOException { final ETag etag = resource.getETag(); final Date lastModified = resource.getLastModified(); if(req.getDispatcherType() != DispatcherType.INCLUDE) { if (!ETagUtils.handleIfMatch(req.getHeader(Headers.IF_MATCH_STRING), etag, false) || rangeResponse = range.getResponseResult(resource.getContentLength(), req.getHeader(Headers.IF_RANGE_STRING), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart();
@Override public Date getLastModified() { return resource.getLastModified(); }
private void serveFileBlocking(final HttpServletRequest req, final HttpServletResponse resp, final Resource resource) throws IOException { final ETag etag = resource.getETag(); final Date lastModified = resource.getLastModified(); if (req.getDispatcherType() != DispatcherType.INCLUDE) { if (!ETagUtils.handleIfMatch(req.getHeader(Headers.IF_MATCH_STRING), etag, false) || rangeResponse = range.getResponseResult(resource.getContentLength(), req.getHeader(Headers.IF_RANGE_STRING), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if (rangeResponse != null) { start = rangeResponse.getStart();
public boolean checkStillValid() { if (nextMaxAgeCheck > 0) { long time = System.currentTimeMillis(); if (time > nextMaxAgeCheck) { nextMaxAgeCheck = time + cachingResourceManager.getMaxAge(); if (!underlyingResource.getLastModified().equals(lastModifiedDate)) { return false; } } } return true; }
final Date lastModified = resource.getLastModified(); if (!ETagUtils.handleIfMatch(exchange, etag, false) || !DateUtils.handleIfUnmodifiedSince(exchange, lastModified)) { rangeResponse = range.getResponseResult(resource.getContentLength(), exchange.getRequestHeaders().getFirst(Headers.IF_RANGE), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart();
i++; builder.append("<tr class='odd'><td><a class='icon up' href='").append(parent).append("'>[..]</a></td><td>"); builder.append(format.format(resource.getLastModified())).append("</td><td>--</td></tr>\n"); builder.append(entry.isDirectory() ? "dir" : "file"); builder.append("' href='").append(path).append(entry.getName()).append("'>").append(entry.getName()).append("</a></td><td>"); builder.append(format.format(entry.getLastModified())).append("</td><td>"); if (entry.isDirectory()) { builder.append("--");
final Date lastModified = resource.getLastModified(); if (!ETagUtils.handleIfMatch(exchange, etag, false) || !DateUtils.handleIfUnmodifiedSince(exchange, lastModified)) { rangeResponse = range.getResponseResult(resource.getContentLength(), exchange.getRequestHeaders().getFirst(Headers.IF_RANGE), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart();
public CachedResource(final CachingResourceManager cachingResourceManager, final Resource underlyingResource, final String path) { this.cachingResourceManager = cachingResourceManager; this.underlyingResource = underlyingResource; this.directory = underlyingResource.isDirectory(); this.lastModifiedDate = underlyingResource.getLastModified(); if (lastModifiedDate != null) { this.lastModifiedDateString = DateUtils.toDateString(lastModifiedDate); } else { this.lastModifiedDateString = null; } this.eTag = underlyingResource.getETag(); this.name = underlyingResource.getName(); this.cacheKey = new CacheKey(cachingResourceManager, underlyingResource.getCacheKey()); if (cachingResourceManager.getMaxAge() > 0) { nextMaxAgeCheck = System.currentTimeMillis() + cachingResourceManager.getMaxAge(); } else { nextMaxAgeCheck = -1; } }
@Override public Date getLastModified() { return underlying.getLastModified(); }
@Override public Date getLastModified() { return resource.getLastModified(); }
@Override public Date getLastModified() { return underlying.getLastModified(); }
@Override public Date getLastModified() { return resource.getLastModified(); }
public boolean checkStillValid() { if (nextMaxAgeCheck > 0) { long time = System.currentTimeMillis(); if (time > nextMaxAgeCheck) { nextMaxAgeCheck = time + cachingResourceManager.getMaxAge(); if (!underlyingResource.getLastModified().equals(lastModifiedDate)) { return false; } } } return true; }
public boolean checkStillValid() { if (nextMaxAgeCheck > 0) { long time = System.currentTimeMillis(); if (time > nextMaxAgeCheck) { nextMaxAgeCheck = time + cachingResourceManager.getMaxAge(); if (!underlyingResource.getLastModified().equals(lastModifiedDate)) { return false; } } } return true; }
i++; builder.append("<tr class='odd'><td><a class='icon up' href='").append(parent).append("'>[..]</a></td><td>"); builder.append(format.format(resource.getLastModified())).append("</td><td>--</td></tr>\n"); builder.append(entry.isDirectory() ? "dir" : "file"); builder.append("' href='").append(path).append(entry.getName()).append("'>").append(entry.getName()).append("</a></td><td>"); builder.append(format.format(entry.getLastModified())).append("</td><td>"); if (entry.isDirectory()) { builder.append("--");
i++; builder.append("<tr class='odd'><td><a class='icon up' href='").append(parent).append("'>[..]</a></td><td>"); builder.append(format.format(resource.getLastModified())).append("</td><td>--</td></tr>\n"); builder.append(entry.isDirectory() ? "dir" : "file"); builder.append("' href='").append(path).append(entry.getName()).append("'>").append(entry.getName()).append("</a></td><td>"); builder.append(format.format(entry.getLastModified())).append("</td><td>"); if (entry.isDirectory()) { builder.append("--");
public CachedResource(final CachingResourceManager cachingResourceManager, final Resource underlyingResource, final String path) { this.cachingResourceManager = cachingResourceManager; this.underlyingResource = underlyingResource; this.directory = underlyingResource.isDirectory(); this.lastModifiedDate = underlyingResource.getLastModified(); if (lastModifiedDate != null) { this.lastModifiedDateString = DateUtils.toDateString(lastModifiedDate); } else { this.lastModifiedDateString = null; } this.eTag = underlyingResource.getETag(); this.name = underlyingResource.getName(); this.cacheKey = new CacheKey(cachingResourceManager, underlyingResource.getCacheKey()); if (cachingResourceManager.getMaxAge() > 0) { nextMaxAgeCheck = System.currentTimeMillis() + cachingResourceManager.getMaxAge(); } else { nextMaxAgeCheck = -1; } }
public CachedResource(final CachingResourceManager cachingResourceManager, final Resource underlyingResource, final String path) { this.cachingResourceManager = cachingResourceManager; this.underlyingResource = underlyingResource; this.directory = underlyingResource.isDirectory(); this.lastModifiedDate = underlyingResource.getLastModified(); if (lastModifiedDate != null) { this.lastModifiedDateString = DateUtils.toDateString(lastModifiedDate); } else { this.lastModifiedDateString = null; } this.eTag = underlyingResource.getETag(); this.name = underlyingResource.getName(); this.cacheKey = new CacheKey(cachingResourceManager, underlyingResource.getCacheKey()); if (cachingResourceManager.getMaxAge() > 0) { nextMaxAgeCheck = System.currentTimeMillis() + cachingResourceManager.getMaxAge(); } else { nextMaxAgeCheck = -1; } }