I'm working on a CoAP app using Eclipse Californium that will declare explicitly only the root resource path, and the rest of the resources should be served and resolved through a wildcard /root/*
just like on REST APIs or servlets.
Is there any way to achieve that ?
This is my solution for this problem.
Ok I managed to do it.
So after a few hours of digging on their Source code here is what ended up doing.
Note that it works but it's only to show how it could be done, it's still a work on progress (I did this in 3h) as I removed some code like observer etc..
As soon as I have some time, I'll digg onto the Californium Api more and make this generic and optimized I'll create a Github project and link it here.
1 : Create a model class
2 : Create an abstract CoapResource that should inject the Wildcards list
3 : Create a Temperature Resource extending AbstractResource
4 : Create a resources directory on the root of my eclipse project, with json conf files of my resources
5 : Create a Resources Loader (class that will load the specs definition of the resources and instantiate them independently instead of creating a Tree on the server)
6 : Create a Custom MessageDelieverer
7 : Create the Server
8 : Start the server
9 : Consume the Temperature resource from a client
Hope that helps someone.