*/  response.setContentType(extInfo.getMimeType());     if (out.isSizePreserving()) { int resourceLen = extInfo .getExternalizer().getLength(extInfo.getObject()); if ( resourceLen > 0 ) { logger.log(Level.FINER, extInfo.getMimeType() + ": " + resourceLen);  } }  Set headers = extInfo.getHeaders(); if ( headers != null ) { for ( Iterator it = headers.iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry) it.next(); response.addHeader( (String) entry.getKey(), (String) entry.getValue()); } }   if (extInfo.isFinal() ) {      response.setDateHeader("Expires", System.currentTimeMillis() + FINAL_EXPIRES); } else {   response.setDateHeader("Expires", 1000); }  extInfo.getExternalizer().write(extInfo.getObject(), out);
deliver(extInfo, response, out);
    public void deliver(ExternalizedResource extInfo, HttpServletResponse response,                        Device out)        throws IOException     {        /* FIXME: re-implement.        if ( extInfo.deliverOnce() ) {            removeExternalizedResource(identifier);        }        */        response.setContentType(extInfo.getMimeType());                // FIXME find out, if this is correct: if the content length        // is not size preserving (like a gzip-device), then we must not        // send the content size we know..        if (out.isSizePreserving()) {            int resourceLen = extInfo                .getExternalizer().getLength(extInfo.getObject());            if ( resourceLen > 0 ) {                logger.log(Level.FINER, extInfo.getMimeType() + ": " + resourceLen);                //response.setContentLength( resourceLen );            }        }        Set headers = extInfo.getHeaders();        if ( headers != null ) {            for ( Iterator it = headers.iterator(); it.hasNext(); ) {                Map.Entry entry = (Map.Entry) it.next();                response.addHeader( (String) entry.getKey(),                                     (String) entry.getValue());            }        }        // non-transient items can be cached by the browser        if (extInfo.isFinal() ) {            /*             * This would be the correct way to do it; alas, that means, that             * for static resources, after a day or so, no caching could take             * place, since the last modification was at the first time, the             * resource was externalized (since it doesn't change).             * .. have to think about it.             */            //response.setDateHeader("Expires",             //                      FINAL_EXPIRES + extInfo.getLastModified());            // .. so do this for now, which is the best approximation of what            // we want.            response.setDateHeader("Expires",                                    System.currentTimeMillis() + FINAL_EXPIRES);        } else {            // expire in deep past ..            // 1000 instead of 0: work around IE bug.            response.setDateHeader("Expires", 1000);         }        extInfo.getExternalizer().write(extInfo.getObject(), out);    }