|
|
@ -17,7 +17,9 @@ import javax.ws.rs.core.MediaType; |
|
|
|
import javax.ws.rs.core.Response; |
|
|
|
import javax.ws.rs.core.Response; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.ResourceBundle; |
|
|
|
|
|
|
|
|
|
|
|
@Path("/") |
|
|
|
@Path("/") |
|
|
|
@Produces(MediaType.TEXT_HTML) |
|
|
|
@Produces(MediaType.TEXT_HTML) |
|
|
@ -25,6 +27,21 @@ public class ApiResource { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ApiResource.class); |
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ApiResource.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
|
|
|
|
@Path("/info") |
|
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON) |
|
|
|
|
|
|
|
public Response info() { |
|
|
|
|
|
|
|
Map<String, String> result = new HashMap<String, String>(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
ResourceBundle resource = ResourceBundle.getBundle("build-info"); |
|
|
|
|
|
|
|
result.put("version", resource.getString("version")); |
|
|
|
|
|
|
|
result.put("timestamp", resource.getString("timestamp")); |
|
|
|
|
|
|
|
} catch (Exception e){ |
|
|
|
|
|
|
|
result.put("version", "LOCAL"); |
|
|
|
|
|
|
|
result.put("timestamp", "NOW"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Response.ok(result).build(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
@GET |
|
|
|
@Path("/validate") |
|
|
|
@Path("/validate") |
|
|
@ -60,5 +77,4 @@ public class ApiResource { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|