@RestResource(path="/config", title="Configuration", description="Contents of configuration file.", htmldoc=) public class ConfigResource extends BasicRestServlet
Constructor and Description |
---|
ConfigResource() |
Modifier and Type | Method and Description |
---|---|
ObjectMap |
getConfig()
[GET /] - Show contents of config file.
|
Form |
getConfigEditForm(RestRequest req)
[GET /edit] - Show config file edit page.
|
String |
getConfigEntry(String section,
String key)
[GET /{section}/{key}] - Show config file entry.
|
ObjectMap |
getConfigSection(String section)
[GET /{section}] - Show config file section.
|
ObjectMap |
setConfigContents(Reader contents)
[PUT /] - Sets contents of config file.
|
ObjectMap |
setConfigContentsFormPost(String contents)
[POST /] - Sets contents of config file from a FORM post.
|
ObjectMap |
setConfigSection(String section,
Map<String,Object> contents)
[PUT /{section}] - Add or overwrite a config file section.
|
String |
setConfigSection(String section,
String key,
String value)
[PUT /{section}/{key}] - Add or overwrite a config file entry.
|
getOptions
destroy, getContext, getProperties, getServletConfig, init, log, log, log, log, logObjects, service
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public ConfigResource()
@RestMethod(name="GET", path="/", description="Show contents of config file.") public ObjectMap getConfig() throws Exception
Exception
@RestMethod(name="GET", path="/edit", description="Edit config file.") public Form getConfigEditForm(RestRequest req) throws Exception
req
- The HTTP request.Exception
@RestMethod(name="GET", path="/{section}", description="Show config file section.", swagger={"parameters:[","{name:\'section\',in:\'path\',description:\'Section name.\'}","]"}) public ObjectMap getConfigSection(@Path(value="section") String section) throws Exception
section
- The section name.Exception
@RestMethod(name="GET", path="/{section}/{key}", description="Show config file entry.", swagger={"parameters:[","{name:\'section\',in:\'path\',description:\'Section name.\'},","{name:\'key\',in:\'path\',description:\'Entry name.\'}","]"}) public String getConfigEntry(@Path(value="section") String section, @Path(value="key") String key) throws Exception
section
- The section name.key
- The section key.Exception
@RestMethod(name="POST", path="/", description="Sets contents of config file from a FORM post.", swagger={"parameters:[","{name:\'contents\',in:\'formData\',description:\'New contents in INI file format.\'}","]"}) public ObjectMap setConfigContentsFormPost(@FormData(value="contents") String contents) throws Exception
contents
- The new contents of the config file.Exception
@RestMethod(name="PUT", path="/", description="Sets contents of config file.", swagger={"parameters:[","{in:\'body\',description:\'New contents in INI file format.\'}","]"}) public ObjectMap setConfigContents(@Body Reader contents) throws Exception
contents
- The new contents of the config file.Exception
@RestMethod(name="PUT", path="/{section}", description="Add or overwrite a config file section.", swagger={"parameters:[","{name:\'section\',in:\'path\',description:\'Section name.\'}","{in:\'body\',description:\'New contents for section as a simple map with string keys and values.\'}","]"}) public ObjectMap setConfigSection(@Path(value="section") String section, @Body Map<String,Object> contents) throws Exception
section
- The section name.contents
- The new contents of the config file section.Exception
@RestMethod(name="PUT", path="/{section}/{key}", description="Add or overwrite a config file entry.", swagger={"parameters:[","{name:\'section\',in:\'path\',description:\'Section name.\'}","{name:\'key\',in:\'path\',description:\'Entry name.\'}","{in:\'body\',description:\'New value as a string.\'}","]"}) public String setConfigSection(@Path(value="section") String section, @Path(value="key") String key, @Body String value) throws Exception
section
- The section name.key
- The section key.value
- The new value.Exception
Copyright © 2018 Apache. All rights reserved.