Skip to content

Commit

Permalink
[Issue 6921][pulsar-broker-common] Replaced "Paths.get(...).getParent…
Browse files Browse the repository at this point in the history
…()", because it's system dependent and uses '\' as path separator on Windows (apache#6992)

Co-authored-by: penghui <penghui@apache.org>
  • Loading branch information
2 people authored and cdbartholomew committed Jul 24, 2020
1 parent 283aa95 commit 8a362c0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.pulsar.broker.cache;

import java.nio.file.Paths;
import java.util.Map;

import org.apache.bookkeeper.util.ZkUtils;
Expand Down Expand Up @@ -127,7 +126,8 @@ public FailureDomain deserialize(String path, byte[] content) throws Exception {

private void createFailureDomainRoot(ZooKeeper zk, String path) {
try {
final String clusterZnodePath = Paths.get(path).getParent().toString();
final int index = path.lastIndexOf('/');
final String clusterZnodePath = (index > 0) ? path.substring(0, index) : null;
if (zk.exists(clusterZnodePath, false) != null && zk.exists(path, false) == null) {
try {
byte[] data = "".getBytes();
Expand Down

0 comments on commit 8a362c0

Please sign in to comment.