Mercurial Hosting > luan
diff src/org/eclipse/jetty/server/handler/ResourceHandler.java @ 1031:921c25a05eaa
remove Buffer.asReadOnlyBuffer()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 03 Nov 2016 02:04:40 -0600 |
parents | 27f3dc761452 |
children |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/handler/ResourceHandler.java Thu Nov 03 01:10:09 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ResourceHandler.java Thu Nov 03 02:04:40 2016 -0600 @@ -30,8 +30,6 @@ import org.eclipse.jetty.http.HttpMethods; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.MimeTypes; -import org.eclipse.jetty.io.Buffer; -import org.eclipse.jetty.io.ByteArrayBuffer; import org.eclipse.jetty.io.WriterOutputStream; import org.eclipse.jetty.server.AbstractHttpConnection; import javax.servlet.RequestDispatcher; @@ -63,7 +61,6 @@ Resource _stylesheet; String[] _welcomeFiles={"index.html"}; MimeTypes _mimeTypes = new MimeTypes(); - ByteArrayBuffer _cacheControl; boolean _aliases; boolean _directory; @@ -233,24 +230,6 @@ } } - /* ------------------------------------------------------------ */ - /** - * @return the cacheControl header to set on all static content. - */ - public String getCacheControl() - { - return _cacheControl.toString(); - } - - /* ------------------------------------------------------------ */ - /** - * @param cacheControl the cacheControl header to set on all static content. - */ - public void setCacheControl(String cacheControl) - { - _cacheControl=cacheControl==null?null:new ByteArrayBuffer(cacheControl); - } - private Resource getResource(Request request) throws MalformedURLException { String path = request.getPathInfo(); @@ -448,17 +427,11 @@ if (length>0) fields.putLongField(HttpHeaders.CONTENT_LENGTH,length); - - if (_cacheControl!=null) - fields.put(HttpHeaders.CACHE_CONTROL,_cacheControl.toString()); } else { if (length>0) response.setHeader(HttpHeaders.CONTENT_LENGTH,Long.toString(length)); - - if (_cacheControl!=null) - response.setHeader(HttpHeaders.CACHE_CONTROL,_cacheControl.toString()); } }