This is an automated email from the ASF dual-hosted git repository.
arshad pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/branch-3.6 by this push:
new cf306c0 ZOOKEEPER-4230: Use dynamic temp folder instead of static
temp folder in RestMain
cf306c0 is described below
commit cf306c07182e642bdbeb26b2a4e90fdda8f8dd5e
Author: Mukti Krishnan <[email protected]>
AuthorDate: Thu Mar 11 10:36:48 2021 +0530
ZOOKEEPER-4230: Use dynamic temp folder instead of static temp folder in
RestMain
Author: Mukti <[email protected]>
Reviewers: Enrico Olivelli <[email protected]>, Mohammad Arshad
<[email protected]>
Closes #1633 from MuktiKrishnan/ZOOKEEPER-4230-master
(cherry picked from commit 04471b2e117a0cbe08c42b0482f0adca93494e7c)
Signed-off-by: Mohammad Arshad <[email protected]>
---
.../src/main/java/org/apache/zookeeper/server/jersey/RestMain.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/RestMain.java
b/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/RestMain.java
index 954ad04..209207f 100644
---
a/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/RestMain.java
+++
b/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/RestMain.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
+import java.nio.file.Files;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,7 +54,8 @@ public class RestMain {
System.out.println("Starting grizzly ...");
boolean useSSL = cfg.useSSL();
- gws = new GrizzlyWebServer(cfg.getPort(), "/tmp/23cxv45345/2131xc2/",
useSSL);
+ String zkRestResourcesTempPath =
Files.createTempDirectory("zkRestResourcesTempPath").toFile().getCanonicalPath();
+ gws = new GrizzlyWebServer(cfg.getPort(), zkRestResourcesTempPath,
useSSL);
// BUG: Grizzly needs a doc root if you are going to register multiple
adapters
for (Endpoint e : cfg.getEndpoints()) {