public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
private HttpContent load(String pathInContext, Resource resource) throws IOException { Content content=null; if (resource==null || !resource.exists()) return null; // Will it fit in the cache? if (!resource.isDirectory() && isCacheable(resource)) { // Create the Content (to increment the cache sizes before adding the content content = new Content(pathInContext,resource); // reduce the cache to an acceptable size. shrinkCache(); // Add it to the cache. Content added = _cache.putIfAbsent(pathInContext,content); if (added!=null) { content.invalidate(); content=added; } return content; } return new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),getMaxCachedFileSize(),_etags); }
private HttpContent load(String pathInContext, Resource resource) throws IOException { Content content=null; if (resource==null || !resource.exists()) return null; // Will it fit in the cache? if (!resource.isDirectory() && isCacheable(resource)) { // Create the Content (to increment the cache sizes before adding the content content = new Content(pathInContext,resource); // reduce the cache to an acceptable size. shrinkCache(); // Add it to the cache. Content added = _cache.putIfAbsent(pathInContext,content); if (added!=null) { content.invalidate(); content=added; } return content; } return new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),getMaxCachedFileSize(),_etags); }
private HttpContent load(String pathInContext, Resource resource) throws IOException { Content content=null; if (resource==null || !resource.exists()) return null; // Will it fit in the cache? if (!resource.isDirectory() && isCacheable(resource)) { // Create the Content (to increment the cache sizes before adding the content content = new Content(pathInContext,resource); // reduce the cache to an acceptable size. shrinkCache(); // Add it to the cache. Content added = _cache.putIfAbsent(pathInContext,content); if (added!=null) { content.invalidate(); content=added; } return content; } return new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),getMaxCachedFileSize(),_etags); }
private HttpContent load(String pathInContext, Resource resource) throws IOException { Content content=null; if (resource==null || !resource.exists()) return null; // Will it fit in the cache? if (!resource.isDirectory() && isCacheable(resource)) { // Create the Content (to increment the cache sizes before adding the content content = new Content(pathInContext,resource); // reduce the cache to an acceptable size. shrinkCache(); // Add it to the cache. Content added = _cache.putIfAbsent(pathInContext,content); if (added!=null) { content.invalidate(); content=added; } return content; } return new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),getMaxCachedFileSize(),_etags); }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
public void flushCache() { if (_cache!=null) { while (_cache.size()>0) { for (String path : _cache.keySet()) { Content content = _cache.remove(path); if (content!=null) content.invalidate(); } } } }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }
boolean isValid() { if (_lastModified==_resource.lastModified() && _length==_resource.length()) { _lastAccessed=System.currentTimeMillis(); return true; } if (this==_cache.remove(_key)) invalidate(); return false; }