I am working with CoAP californium library using java and my problem is that I want to get the requested resource from client in the main function of server here ..
public static void main(String[] args) {
// TODO Auto-generated method stub
// binds on UDP port 5683
CoapServer server=new CoapServer();
// "hello"
server.add(new HelloResource());
// "subpath/Another"
CoapResource path=new CoapResource("subpath");
path.add(new AnotherResource());
server.add(path);
server.add(new RemovableResource(),new TimeResource(),new WritableResource());
System.out.println("Resources added");
server.start();
}
what I should write after server.start()
.. I know that the server use function deliverRequest(final Exchange exchange)
function and findResource(final List<String> list)
to search for the requested resource in the reasources tree.. but I want to get this value and store it in a variable in the main function of server