formatting of eclipse import tutorial authored by Björn Butzin's avatar Björn Butzin
...@@ -82,8 +82,8 @@ You can find the required files in our repository at [https://gitlab.amd.e-techn ...@@ -82,8 +82,8 @@ You can find the required files in our repository at [https://gitlab.amd.e-techn
5. Run the ResourceServer 5. Run the ResourceServer
#### 1. Create a new resource class TemperatureResource (TemperatureResource.java): #### 1. Create a new resource class TemperatureResource (TemperatureResource.java):
* We could have used the predefined BasicCoapResource * We could have used the predefined `BasicCoapResource`
* BasicCoapResource is a resource that just keeps a static `byte[]` which is: * `BasicCoapResource` is a resource that just keeps a static `byte[]` which is:
* returned on GET requests * returned on GET requests
* replaced by the payload on PUT requests * replaced by the payload on PUT requests
* appended with the payload on POST requests * appended with the payload on POST requests
...@@ -91,11 +91,11 @@ You can find the required files in our repository at [https://gitlab.amd.e-techn ...@@ -91,11 +91,11 @@ You can find the required files in our repository at [https://gitlab.amd.e-techn
* We do not want a static `byte[]` * We do not want a static `byte[]`
* Instead we want a random number to be returned on a GET * Instead we want a random number to be returned on a GET
* PUT, POST and DELETE are not used * PUT, POST and DELETE are not used
* ->So we implemented TemperatureResource which extends BasicCoapResource with: * ->So we implemented `TemperatureResource` which extends `BasicCoapResource` with:
* A constructor to initialize the resource and disallow POST, PUT and DELETE requests * A constructor to initialize the resource and disallow POST, PUT and DELETE requests
* Two get() Methods: * Two get() Methods:
* Get a list of accepted media types [& query parameters] which returns a `byte[]` together with its media type * Get a list of accepted media types [& query parameters] which returns a `byte[]` together with its media type
```java ```Java
CoapData get(List<CoapMediaType> mediaTypesAccepted) CoapData get(List<CoapMediaType> mediaTypesAccepted)
CoapData get(List<String> query, List<CoapMediaType> mediaTypesAccepted) CoapData get(List<String> query, List<CoapMediaType> mediaTypesAccepted)
``` ```
... ...
......