Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[grid] Using the temp file system utility
With this, it will be transparent for the user
where files are written, and since we use the
caches then the deletion happens when the session
is closed.

Also, we do not need the `--base-dir-downloads`
parameter.
  • Loading branch information
diemol committed Mar 14, 2023
commit 729f71b919046dc469688a8f7e346ed20973cff7
13 changes: 10 additions & 3 deletions java/src/org/openqa/selenium/grid/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
package org.openqa.selenium.grid.node;

import com.google.common.collect.ImmutableMap;

import org.openqa.selenium.BuildInfo;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.NoSuchSessionException;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.grid.data.CreateSessionRequest;
import org.openqa.selenium.grid.data.CreateSessionResponse;
import org.openqa.selenium.grid.data.NodeId;
Expand All @@ -41,13 +43,13 @@
import org.openqa.selenium.remote.tracing.SpanDecorator;
import org.openqa.selenium.remote.tracing.Tracer;
import org.openqa.selenium.status.HasReadyState;
import org.openqa.selenium.WebDriverException;

import java.io.IOException;
import java.net.URI;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
Expand Down Expand Up @@ -210,16 +212,21 @@ public ImmutableMap<String, String> getOsInfo() {
return OS_INFO;
}

public abstract Either<WebDriverException, CreateSessionResponse> newSession(CreateSessionRequest sessionRequest);
public abstract Either<WebDriverException, CreateSessionResponse> newSession(
CreateSessionRequest sessionRequest);

public abstract HttpResponse executeWebDriverCommand(HttpRequest req);

public abstract Session getSession(SessionId id) throws NoSuchSessionException;

public TemporaryFilesystem getTemporaryFilesystem(SessionId id) throws IOException {
public TemporaryFilesystem getUploadsFilesystem(SessionId id) throws IOException {
throw new UnsupportedOperationException();
}

public TemporaryFilesystem getDownloadsFilesystem(UUID uuid) throws IOException {
throw new UnsupportedOperationException();
}

public abstract HttpResponse uploadFile(HttpRequest req, SessionId id);

public abstract HttpResponse downloadFile(HttpRequest req, SessionId id);
Expand Down
7 changes: 0 additions & 7 deletions java/src/org/openqa/selenium/grid/node/config/NodeFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,6 @@ public class NodeFlags implements HasRoles {
@ConfigValue(section = NODE_SECTION, name = "enable-managed-downloads", example = "false")
public Boolean managedDownloadsEnabled;

@Parameter(
names = {"--base-dir-downloads"},
description = "The base directory into which all downloads would be saved. If no value "
+ "is specified then this defaults to the user's home directory.")
@ConfigValue(section = NODE_SECTION, name = "base-dir-downloads", example = "user.home")
public String downloadsBaseDir;

@Override
public Set<Role> getRoles() {
return Collections.singleton(NODE_ROLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ public boolean isManagedDownloadsEnabled() {
.orElse(Boolean.FALSE);
}

public String downloadsBaseDirectory() {
return config.get(NODE_SECTION, "base-dir-downloads")
.orElse(System.getProperty("user.home"));
}

public Node getNode() {
return config.getClass(NODE_SECTION, "implementation", Node.class, DEFAULT_NODE_IMPLEMENTATION);
}
Expand Down
Loading