/**
* Returns the root Restlet of this application.
*/
@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach(ENVIRONMENT_PATH+"/", EnvironmentsServerResource.class);
router.attach(ENVIRONMENT_PATH+"/{number}", EnvironmentServerResource.class);
router.attach(ENVIRONMENT_PATH+"/{env}/zones/", ZonesServerResource.class);
router.attach(ENVIRONMENT_PATH+"/{env}/zones/{number}", ZoneServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/objects/", ObjectsServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/objects/{name}", ObjectServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/plugins/", PluginsServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/commands/hardware/", HardwareCommandsServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/commands/user/", UserCommandsServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/triggers/", TriggersServerResource.class);
router.attach(FREEDOMOTIC_PATH+"/resources/{filename}", ImageResourceServerResource.class);
router.attach(USER_PATH + "/{useraction}", UserServerResource.class);
//Expose the resources dir as static server
Directory dir = new Directory(getContext(), FILE_AND_SLASHES + resourcesPath);
dir.setListingAllowed(true);
//System.out.println("FILE_AND_SLASHES+resourcesPath "+ FILE_AND_SLASHES+resourcesPath);
router.attach(RESOURCES_PATH + "/", dir);
return router;
}