001/* 002 * (C) Copyright 2006-2010 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * bstefanescu 016 */ 017package org.nuxeo.ecm.webengine.app; 018 019import javax.servlet.http.HttpServletRequest; 020import javax.ws.rs.core.HttpHeaders; 021import javax.ws.rs.core.UriInfo; 022 023import org.nuxeo.ecm.webengine.model.impl.AbstractWebContext; 024 025/** 026 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a> 027 */ 028public class DefaultContext extends AbstractWebContext { 029 030 // FIXME: these two members must be removed - they are redundant and buggy 031 protected UriInfo info; 032 033 protected HttpHeaders headers; 034 035 public DefaultContext(HttpServletRequest request) { 036 super(request); 037 } 038 039 @Deprecated 040 public HttpHeaders getHttpHeaders() { 041 // throw new UnsupportedOperationException("Deprecated. Use @Context HttpHeaders to inject this object"); 042 return headers; 043 } 044 045 @Deprecated 046 public UriInfo getUriInfo() { 047 // throw new UnsupportedOperationException("Deprecated. Use @Context UriInfo to inject this object"); 048 return info; 049 } 050 051 public void setUriInfo(UriInfo info) { 052 this.info = info; 053 } 054 055 public void setHttpHeaders(HttpHeaders headers) { 056 this.headers = headers; 057 } 058 059}