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

com.github.dynamicextensionsalfresco.webscripts.arguments.HeaderArgumentResolver Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.webscripts.arguments;

import java.lang.annotation.Annotation;

import com.github.dynamicextensionsalfresco.webscripts.annotations.Header;

import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;

/**
 * {@link ArgumentResolver} that maps String parameters annotated with {@link Header}.
 * 
 * @author Laurens Fridael
 * 
 */
public class HeaderArgumentResolver implements ArgumentResolver {

	@Override
	public boolean supports(final Class argumentType, final Class annotationType) {
		return String.class.equals(argumentType) && Header.class.equals(annotationType);
	}

	@Override
	public String resolveArgument(final Class argumentType, final Header header, final String name,
			final WebScriptRequest request, final WebScriptResponse response) {
		return request.getHeader(header.value());
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy