com.tinkerpop.rexster.RootResource Maven / Gradle / Ivy
package com.tinkerpop.rexster;
import com.tinkerpop.rexster.server.RexsterApplication;
import com.tinkerpop.rexster.extension.HttpMethod;
import javax.ws.rs.GET;
import javax.ws.rs.OPTIONS;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
/**
* The root resources for Rexster which shows the splash page for Rexster as HTML.
*
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
@Path("/")
public class RootResource extends BaseResource {
public RootResource() {
super(null);
}
public RootResource(final RexsterApplication ra) {
super(ra);
}
@OPTIONS
public Response optionsRoot() {
return buildOptionsResponse(HttpMethod.GET.toString());
}
@GET
@Produces({MediaType.TEXT_HTML})
public Response getRoot() {
StringBuffer sb = new StringBuffer();
sb.append("");
sb.append("Rexster ");
sb.append("");
sb.append("");
sb.append("");
sb.append("Rexster - " + Tokens.REXSTER_VERSION + "
");
sb.append("");
sb.append("");
sb.append("");
sb.append("");
sb.append("");
return Response.ok(sb.toString()).build();
}
}