Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion java/src/org/openqa/selenium/remote/FileDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
package org.openqa.selenium.remote;

import java.io.File;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/** Used for identifying whether a sequence of chars represents the path to a file. */
@NullMarked
public interface FileDetector {
File getLocalFile(CharSequence... keys);
@Nullable File getLocalFile(CharSequence... keys);
}
5 changes: 4 additions & 1 deletion java/src/org/openqa/selenium/remote/LocalFileDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@

import java.io.File;
import java.util.logging.Logger;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/** Detects files on the local disk. */
@NullMarked
public class LocalFileDetector implements FileDetector {

private static final Logger LOG = Logger.getLogger(LocalFileDetector.class.getName());

@Override
public File getLocalFile(CharSequence... keys) {
public @Nullable File getLocalFile(CharSequence... keys) {
StringBuilder builder = new StringBuilder();
for (CharSequence chars : keys) {
builder.append(chars);
Expand Down
5 changes: 4 additions & 1 deletion java/src/org/openqa/selenium/remote/UselessFileDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
package org.openqa.selenium.remote;

import java.io.File;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/** A file detector that never finds anything. */
@NullMarked
public class UselessFileDetector implements FileDetector {
@Override
public File getLocalFile(CharSequence... keys) {
public @Nullable File getLocalFile(CharSequence... keys) {
return null;
}
}