Skip to content

Commit 51083a8

Browse files
authored
[java] Removing deprecated items in Require.java (SeleniumHQ#15711)
1 parent 2b950b1 commit 51083a8

File tree

1 file changed

+0
-105
lines changed

1 file changed

+0
-105
lines changed

java/src/org/openqa/selenium/internal/Require.java

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.openqa.selenium.internal;
1919

20-
import java.io.File;
2120
import java.nio.file.Files;
2221
import java.nio.file.Path;
2322
import java.time.Duration;
@@ -161,11 +160,6 @@ public static IntChecker argument(String argName, @Nullable Integer number) {
161160
return new IntChecker(argName, number);
162161
}
163162

164-
@Deprecated(forRemoval = true)
165-
public static FileChecker argument(String argName, @Nullable File file) {
166-
return new FileChecker(argName, file);
167-
}
168-
169163
public static PathChecker argument(String argName, @Nullable Path path) {
170164
return new PathChecker(argName, path);
171165
}
@@ -180,11 +174,6 @@ public static <T> StateChecker<T> state(String name, @Nullable T state) {
180174
return new StateChecker<>(name, state);
181175
}
182176

183-
@Deprecated(forRemoval = true)
184-
public static FileStateChecker state(String name, @Nullable File file) {
185-
return new FileStateChecker(name, file);
186-
}
187-
188177
public static PathStateChecker state(String name, @Nullable Path path) {
189178
return new PathStateChecker(name, path);
190179
}
@@ -255,48 +244,6 @@ public int greaterThan(int max, String message) {
255244
}
256245
}
257246

258-
@Deprecated(forRemoval = true)
259-
public static class FileChecker {
260-
261-
private final String argName;
262-
private final @Nullable File file;
263-
264-
FileChecker(String argName, @Nullable File file) {
265-
this.argName = argName;
266-
this.file = file;
267-
}
268-
269-
public File isFile() {
270-
if (file == null) {
271-
throw new IllegalArgumentException(String.format(MUST_BE_SET, argName));
272-
}
273-
if (!file.exists()) {
274-
throw new IllegalArgumentException(
275-
String.format(MUST_EXIST, argName, file.getAbsolutePath()));
276-
}
277-
if (!file.isFile()) {
278-
throw new IllegalArgumentException(
279-
String.format(MUST_BE_FILE, argName, file.getAbsolutePath()));
280-
}
281-
return file;
282-
}
283-
284-
public File isDirectory() {
285-
if (file == null) {
286-
throw new IllegalArgumentException(String.format(MUST_BE_SET, argName));
287-
}
288-
if (!file.exists()) {
289-
throw new IllegalArgumentException(
290-
String.format(MUST_EXIST, argName, file.getAbsolutePath()));
291-
}
292-
if (!file.isDirectory()) {
293-
throw new IllegalArgumentException(
294-
String.format(MUST_BE_DIR, argName, file.getAbsolutePath()));
295-
}
296-
return file;
297-
}
298-
}
299-
300247
public static class PathChecker {
301248

302249
private final String argName;
@@ -373,58 +320,6 @@ public T instanceOf(Class<?> cls) {
373320
}
374321
}
375322

376-
@Deprecated(forRemoval = true)
377-
public static class FileStateChecker {
378-
379-
private final String name;
380-
private final @Nullable File file;
381-
382-
FileStateChecker(String name, @Nullable File file) {
383-
this.name = name;
384-
this.file = file;
385-
}
386-
387-
public File isFile() {
388-
if (file == null) {
389-
throw new IllegalStateException(String.format(MUST_BE_SET, name));
390-
}
391-
if (!file.exists()) {
392-
throw new IllegalStateException(String.format(MUST_EXIST, name, file.getAbsolutePath()));
393-
}
394-
if (!file.isFile()) {
395-
throw new IllegalStateException(String.format(MUST_BE_FILE, name, file.getAbsolutePath()));
396-
}
397-
return file;
398-
}
399-
400-
public File isDirectory() {
401-
if (file == null) {
402-
throw new IllegalStateException(String.format(MUST_BE_SET, name));
403-
}
404-
if (!file.exists()) {
405-
throw new IllegalStateException(String.format(MUST_EXIST, name, file.getAbsolutePath()));
406-
}
407-
if (!file.isDirectory()) {
408-
throw new IllegalStateException(String.format(MUST_BE_DIR, name, file.getAbsolutePath()));
409-
}
410-
return file;
411-
}
412-
413-
public File isExecutable() {
414-
if (file == null) {
415-
throw new IllegalStateException(String.format(MUST_BE_SET, name));
416-
}
417-
if (!file.exists()) {
418-
throw new IllegalStateException(String.format(MUST_EXIST, name, file.getAbsolutePath()));
419-
}
420-
if (!file.canExecute()) {
421-
throw new IllegalStateException(
422-
String.format(MUST_BE_EXECUTABLE, name, file.getAbsolutePath()));
423-
}
424-
return file;
425-
}
426-
}
427-
428323
public static class PathStateChecker {
429324

430325
private final String name;

0 commit comments

Comments
 (0)