Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
Expand All @@ -37,6 +35,7 @@
import java.util.OptionalInt;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdds.conf.ConfigurationSource;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.client.HddsClientUtils;
Expand Down Expand Up @@ -608,7 +607,7 @@ public static boolean isAccessControlException(Exception ex) {
}

/**
* Normalize the key name. This method used {@link Path#normalize()} to
* Normalize the key name. This method used {@link Path} to
* normalize the key name.
* @param keyName
* @param preserveTrailingSlash - if True preserves trailing slash, else
Expand All @@ -623,10 +622,10 @@ public static String normalizeKey(String keyName,
if (!StringUtils.isBlank(keyName)) {
String normalizedKeyName;
if (keyName.startsWith(OM_KEY_PREFIX)) {
normalizedKeyName = Paths.get(keyName).toUri().normalize().getPath();
normalizedKeyName = new Path(keyName).toUri().getPath();
} else {
normalizedKeyName = Paths.get(OM_KEY_PREFIX, keyName).toUri()
.normalize().getPath();
normalizedKeyName = new Path(OM_KEY_PREFIX + keyName)
.toUri().getPath();
}
if (!keyName.equals(normalizedKeyName)) {
LOG.debug("Normalized key {} to {} ", keyName,
Expand Down