Skip to content

Commit

Permalink
SNOW-1163212: Handle nested path on Windows in client config parser (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dprzybysz authored May 22, 2024
1 parent ffb87d7 commit fb23408
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ static String convertToWindowsPath(String filePath) {
filePath = filePath.substring(1);
} else if (filePath.startsWith("file:\\")) {
filePath = filePath.substring(6);
} else if (filePath.startsWith("nested:\\")) {
filePath = filePath.substring(8);
} else if (filePath.startsWith("\\")) {
filePath = filePath.substring(2);
} else if (matcher.find() && matcher.start() != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ public void testgetConfigFileNameFromJDBCJarLocation() {
}

@Test
public void testconvertToWindowsPath() {
public void testConvertToWindowsPath() {
String mockWindowsPath = "C:/Program Files/example.txt";
String resultWindowsPath = "C:\\Program Files\\example.txt";
String[] testCases = new String[] {"", "file:\\", "\\\\", "/"};
String[] testCases = new String[] {"", "file:\\", "\\\\", "/", "nested:\\"};
String mockCloudPrefix = "cloud://";

for (String testcase : testCases) {
Expand Down

0 comments on commit fb23408

Please sign in to comment.