Package org.eclipse.jetty.http

Examples of org.eclipse.jetty.http.PreEncodedHttpField


            synchronized (this) // Trade some contention for less garbage
            {
                df = _dateField;
                if (df==null || df._seconds!=seconds)
                {
                    HttpField field=new PreEncodedHttpField(HttpHeader.DATE,DateGenerator.formatDate(now));
                    _dateField=new DateField(seconds,field);
                    return field;
                }
            }
        }
View Full Code Here


            LOG.debug(e);
        }

        String cc=getInitParameter("cacheControl");
        if (cc!=null)
            _cacheControl=new PreEncodedHttpField(HttpHeader.CACHE_CONTROL, cc);
       
        String resourceCache = getInitParameter("resourceCache");
        int max_cache_size=getInitInt("maxCacheSize", -2);
        int max_cached_file_size=getInitInt("maxCachedFileSize", -2);
        int max_cached_files=getInitInt("maxCachedFiles", -2);
View Full Code Here

        {
            _key=pathInContext;
            _resource=resource;

            String contentType = _mimeTypes.getMimeByExtension(_resource.toString());
            _contentType=contentType==null?null:new PreEncodedHttpField(HttpHeader.CONTENT_TYPE,contentType);
            _characterEncoding = _contentType==null?null:MimeTypes.getCharsetFromContentType(contentType);
            _mimeType = _contentType==null?null:MimeTypes.CACHE.get(MimeTypes.getContentTypeWithoutCharset(contentType));
           
            boolean exists=resource.exists();
            _lastModifiedValue=exists?resource.lastModified():-1L;
            _lastModified=_lastModifiedValue==-1?null
                :new PreEncodedHttpField(HttpHeader.LAST_MODIFIED,DateGenerator.formatDate(_lastModifiedValue));
           
            _contentLengthValue=exists?(int)resource.length():0;
            _contentLength=new PreEncodedHttpField(HttpHeader.CONTENT_LENGTH,Long.toString(_contentLengthValue));
           
            _cachedSize.addAndGet(_contentLengthValue);
            _cachedFiles.incrementAndGet();
            _lastAccessed=System.currentTimeMillis();
           
            _etag=ResourceCache.this._etagSupported?new PreEncodedHttpField(HttpHeader.ETAG,resource.getWeakETag()):null;
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.http.PreEncodedHttpField

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.