| | |
| | | public class ConfigurationRest { |
| | | private Logger log = LoggerFactory.getLogger(ConfigurationRest.class); |
| | | |
| | | @GET |
| | | @Path("config") |
| | | @Produces(MediaType.APPLICATION_JSON) |
| | | /** |
| | | * |
| | | * @param prettyPrinter If true then the json output will be in pretty format. |
| | | * @see JsonUtils#toJson(Object, boolean) |
| | | */ |
| | | @GET |
| | | @Path("config") |
| | | @Produces(MediaType.APPLICATION_JSON) |
| | | public String getConfig(@QueryParam("prettyPrinter") boolean prettyPrinter) { |
| | | String json = JsonUtils.toJson(ServerConfiguration.get(), prettyPrinter); |
| | | return json; |
| | |
| | | configurationHandler.save(); |
| | | } |
| | | |
| | | @GET |
| | | @Path("user") |
| | | @Produces(MediaType.APPLICATION_JSON) |
| | | /** |
| | | * |
| | | * @param prettyPrinter If true then the json output will be in pretty format. |
| | | * @see JsonUtils#toJson(Object, boolean) |
| | | */ |
| | | @GET |
| | | @Path("user") |
| | | @Produces(MediaType.APPLICATION_JSON) |
| | | public String getUser(@QueryParam("prettyPrinter") boolean prettyPrinter) { |
| | | UserData user = RestUtils.getUser(); |
| | | String json = JsonUtils.toJson(user, prettyPrinter); |