Commit edc706d2 authored by Franz Reischl's avatar Franz Reischl
Browse files

Request version

parent d5584f64
package university.at.jku.ce.resource;
import university.at.jku.ce.exception.ExceptionParam;
import javax.annotation.security.PermitAll;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.*;
import java.util.HashMap;
@Path("/version")
public class VersionResource {
@PermitAll
@GET
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getUsers(@Context HttpHeaders headers) {
System.out.println("Version requested");
ExceptionParam.setMediaType(headers.getMediaType());
HashMap<String, String> versionNumber = new HashMap<>();
versionNumber.put("version", "2.0");
GenericEntity<HashMap<String, String>> entity = new GenericEntity<HashMap<String, String>>(versionNumber) {
};
return Response.ok(entity).build();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment