labelingsystem-server  Version 0.1.0.0
RestResource Class Reference

Public Member Functions

Response getAPIpage ()
 

Member Function Documentation

◆ getAPIpage()

Response getAPIpage ( )
19  {
20  try {
21  JSONObject outObject = new JSONObject();
22  outObject.put("title", "Labeling System API Version 1.0");
23  outObject.put("version", "1.0");
24  outObject.put("info", ConfigProperties.getPropertyParam("api") + "/v1/info");
25  // get last modified data
26  File file = new File(InfoResource.class.getClassLoader().getResource("configLabelingLink.properties").getFile());
27  SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
28  outObject.put("last build", sdf.format(file.lastModified()));
29  return Response.ok(outObject).header("Content-Type", "application/json;charset=UTF-8").build();
30  } catch (Exception e) {
31  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(Logging.getMessageJSON(e, "v1.rest.RestResource"))
32  .header("Content-Type", "application/json;charset=UTF-8").build();
33  }
34  }

References Logging.getMessageJSON(), and ConfigProperties.getPropertyParam().

Exception