@Rest(path="/config", title="Configuration", description="Contents of configuration file.") @HtmlDocConfig(navlinks={"up: request:/..","options: servlet:/?method=OPTIONS","edit: servlet:/edit"}) public class ConfigResource extends BasicRestServlet
| Constructor and Description |
|---|
ConfigResource() |
| Modifier and Type | Method and Description |
|---|---|
ObjectMap |
getConfig() |
Form |
getConfigEditForm() |
String |
getConfigEntry(String section,
String key) |
ObjectMap |
getConfigSection(String section) |
ObjectMap |
setConfigContents(Reader contents) |
ObjectMap |
setConfigContentsFormPost(String contents) |
ObjectMap |
setConfigSection(String section,
Map<String,Object> contents) |
String |
setConfigValue(String section,
String key,
String value) |
getOptionsdestroy, getContext, getPath, getProperties, getRequest, getResponse, getServletConfig, init, log, log, log, log, logObjects, service, setContext, setRestResourceResolverdoDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, servicegetInitParameter, getInitParameterNames, getServletContext, getServletInfo, getServletName, initpublic ConfigResource()
@RestMethod(name="GET", path="/", summary="Get config file contents", description="Show contents of config file as an ObjectMap.", swagger=) public ObjectMap getConfig()
@RestMethod(name="GET", path="/edit", summary="Render form entry page for editing config file", description="Renders a form entry page for editing the raw text of a config file.") public Form getConfigEditForm()
@RestMethod(name="GET", path="/{section}", summary="Get config file section contents", description="Show contents of config file section as an ObjectMap.", swagger=) public ObjectMap getConfigSection(@Path(name="section",description="Section name in config file.",example="REST") String section) throws org.apache.juneau.microservice.resources.ConfigResource.SectionNotFound, org.apache.juneau.microservice.resources.ConfigResource.BadConfig
org.apache.juneau.microservice.resources.ConfigResource.SectionNotFoundorg.apache.juneau.microservice.resources.ConfigResource.BadConfig@RestMethod(name="GET", path="/{section}/{key}", summary="Get config file entry value", description="Show value of config file entry as a simple string.", swagger=) public String getConfigEntry(@Path(name="section",description="Section name in config file.",example="REST") String section, @Path(name="key",description="Key name in section.",example="theme") String key) throws org.apache.juneau.microservice.resources.ConfigResource.SectionNotFound, org.apache.juneau.microservice.resources.ConfigResource.BadConfig
org.apache.juneau.microservice.resources.ConfigResource.SectionNotFoundorg.apache.juneau.microservice.resources.ConfigResource.BadConfig@RestMethod(name="POST", path="/", summary="Update config file contents", description="Update the contents of the config file from a FORM post.", swagger=) public ObjectMap setConfigContentsFormPost(@FormData(name="contents",description="New contents in INI file format.") String contents) throws Exception
Exception@RestMethod(name="PUT", path="/", summary="Update config file contents", description="Update the contents of the config file from raw text.", swagger=) public ObjectMap setConfigContents(@Body(description="New contents in INI file format.") Reader contents) throws Exception
Exception@RestMethod(name="PUT", path="/{section}", summary="Update config section contents", description="Add or overwrite a config file section.", swagger=) public ObjectMap setConfigSection(@Path(name="section",description="Section name in config file.",example="REST") String section, @Body(description="New contents of config section as a simple map of key/value pairs.",example="{theme:\'servlet:/htdocs/themes/dark.css\'}") Map<String,Object> contents) throws Exception
Exception@RestMethod(name="PUT", path="/{section}/{key}", summary="Update config entry value", description="Add or overwrite a config file entry.", swagger=) public String setConfigValue(@Path(name="section",description="Section name in config file.",example="REST") String section, @Path(name="key",description="Key name in section.",example="theme") String key, @Body(description="New value for entry.",example="servlet:/htdocs/themes/dark.css") String value) throws org.apache.juneau.microservice.resources.ConfigResource.SectionNotFound, org.apache.juneau.microservice.resources.ConfigResource.BadConfig
org.apache.juneau.microservice.resources.ConfigResource.SectionNotFoundorg.apache.juneau.microservice.resources.ConfigResource.BadConfigCopyright © 2016–2019 The Apache Software Foundation. All rights reserved.