Commit cd2ce77b authored by René Schöne's avatar René Schöne
Browse files

Remove scheme from config for ros2rag applications.

parent 1962851c
......@@ -9,6 +9,7 @@ import de.tudresden.inf.st.ros2rag.common.DataConfiguration.ActualConfiguration;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.Map;
import java.util.SortedMap;
......@@ -24,7 +25,11 @@ public class Util {
ObjectMapper mapper = new ObjectMapper(
new YAMLFactory().configure(JsonParser.Feature.ALLOW_YAML_COMMENTS, true)
);
return mapper.readValue(configFile, DataConfiguration.class).panda_mqtt_connector;
ActualConfiguration config = mapper.readValue(configFile, DataConfiguration.class).panda_mqtt_connector;
URI serverUri = URI.create(config.server);
config.server = serverUri.getHost() + ":" + (serverUri.getPort() == -1 ? 1883 : serverUri.getPort())
+ serverUri.getPath();
return config;
}
public static void setMqttHost(SetHost handler, ActualConfiguration config) throws IOException {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment