package vs;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.Request;
import jakarta.ws.rs.core.UriInfo;

@Path("/hello")
public class HelloWorld2 {
	@Context UriInfo uriInfo;
	@Context Request request;

	@GET
	@Path("/1/{param}")
	@Produces("text/plain")

	public String helloWorld(@PathParam("param") String parameter, @Context HttpHeaders headers) {
		if (headers.getRequestHeaders().containsKey("HelloHeader")) {
			return "Hello World";
		} else {
			return "dlroW olleH";
		}
	}

	
	@GET
	@Path("/2/{param}")
	@Produces("text/plain")
	public String helloWorldRechtsrum(@PathParam("param") String parameter) {
		return "Hello World 2/" + parameter;
	}
}
