Skip to content

Commit 06d99f0

Browse files
committed
Fix URI to have right number of slashes
1 parent add97f5 commit 06d99f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/R/sparkR.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ sparkR.init <- function(
9090
normalizePath(c(as.character(.sparkREnv$assemblyJarPath), as.character(sparkJars))))
9191

9292
# Classpath separator is ";" on Windows
93+
# URI needs four /// as from http://stackoverflow.com/a/18522792
9394
if (.Platform$OS.type == "unix") {
9495
collapseChar <- ":"
96+
uriSep <- "//"
9597
} else {
9698
collapseChar <- ";"
99+
uriSep <- "////"
97100
}
98101
cp <- paste0(jars, collapse = collapseChar)
99102

@@ -131,7 +134,7 @@ sparkR.init <- function(
131134
}
132135

133136
nonEmptyJars <- Filter(function(x) { x != "" }, jars)
134-
localJarPaths <- sapply(nonEmptyJars, function(j) { utils::URLencode(paste("file://", j, sep = "")) })
137+
localJarPaths <- sapply(nonEmptyJars, function(j) { utils::URLencode(paste("file:", uriSep, j, sep = "")) })
135138

136139
assign(
137140
".sparkRjsc",

0 commit comments

Comments
 (0)