All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jk.services.server.JKServiceRequestWrapper Maven / Gradle / Ivy

Go to download

A set wrappers, filters, and API's that enables faster development in microservices in Java

The newest version!
/*
 * Copyright 2002-2023 Dr. Jalal Kiswani. 
 * Email: [email protected]
 * Check out https://j-framework.com for more details
 * 
 * All the opensource projects of Dr. Jalal Kiswani are free for personal and academic use only, 
 * for commercial usage and support, please contact the author.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jk.services.server;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.ws.rs.core.HttpHeaders;

/**
 * This class is a request wrapper class that extends
 * {@code HttpServletRequestWrapper}.
 * 
 * @author Dr. Jalal H. Kiswani
 * @version 1.0
 */
public class JKServiceRequestWrapper extends HttpServletRequestWrapper {

	/**
	 * Represents the HTTP headers associated with the request.
	 */
	HttpHeaders headers;

	/**
	 * This method constructs a new {@code JKServiceRequestWrapper}.
	 *
	 * @param request     Specifies the original HTTP request.
	 * @param httpheaders Specifies the HTTP headers associated with the request.
	 */
	public JKServiceRequestWrapper(HttpServletRequest request, HttpHeaders httpheaders) {
		super(request);
		headers = httpheaders;
	}

	/**
	 * This method gets the HTTP headers associated with the request.
	 *
	 * @return the HTTP headers associated with the request.
	 */
	public HttpHeaders getHeaders() {
		return headers;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String getHeader(String name) {
		return headers.getHeaderString(name);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy