-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartUI.java
More file actions
29 lines (23 loc) · 872 Bytes
/
StartUI.java
File metadata and controls
29 lines (23 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ru.job4j.searchtool;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.function.Predicate;
public class StartUI {
public static void main(String[] args) throws IOException {
Search run = new Search();
List<Path> pathList;
boolean argsCheck = run.argsVerification(args);
if (argsCheck) {
String searchType = run.getValues().get("t");
String inputSearch = run.getValues().get("n");
String logPath = run.getValues().get("o");
Path dirPath = Path.of(run.getValues().get("d"));
Predicate<Path> predicate = run.searchType(searchType, inputSearch);
pathList = run.search(dirPath, predicate);
if (run.isReadyToSave()) {
run.savePaths(pathList, logPath);
}
}
}
}