Add helper method to create valid dbus object path

This commit is contained in:
AsamK 2023-06-02 21:29:58 +02:00
parent c852bd8a85
commit d0d3e20713
3 changed files with 18 additions and 6 deletions

View file

@ -56,6 +56,8 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import static org.asamk.signal.dbus.DbusUtils.makeValidObjectPathElement;
public class DbusSignalImpl implements Signal {
private final Manager m;
@ -980,11 +982,7 @@ public class DbusSignalImpl implements Signal {
}
private static String getGroupObjectPath(String basePath, byte[] groupId) {
return basePath + "/Groups/" + Base64.getEncoder()
.encodeToString(groupId)
.replace("+", "_")
.replace("/", "_")
.replace("=", "_");
return basePath + "/Groups/" + makeValidObjectPathElement(Base64.getEncoder().encodeToString(groupId));
}
private void updateGroups() {