File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
main/java/com/apiflows/parser/util
test/java/com/apiflows/parser/util Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 3
3
import org .slf4j .Logger ;
4
4
import org .slf4j .LoggerFactory ;
5
5
6
+ import java .io .File ;
6
7
import java .io .IOException ;
7
8
import java .nio .file .Files ;
8
9
import java .nio .file .Paths ;
@@ -21,4 +22,8 @@ public String getFromFile(String filepath) {
21
22
22
23
return content ;
23
24
}
25
+
26
+ public boolean isFile (String filepath ) {
27
+ return new File (filepath ).isFile ();
28
+ }
24
29
}
Original file line number Diff line number Diff line change @@ -14,4 +14,16 @@ void getFromFile() {
14
14
assertFalse (pathUtil .getFromFile (WORKFLOWS_SPEC_FILE ).isEmpty ());
15
15
}
16
16
17
+ @ Test
18
+ void isFile () {
19
+ final String WORKFLOWS_SPEC_FILE = "src/test/resources/1.0.0/pet-coupons.workflow.yaml" ;
20
+ assertTrue (pathUtil .isFile (WORKFLOWS_SPEC_FILE ));
21
+ }
22
+
23
+ @ Test
24
+ void isFileFalse () {
25
+ final String WORKFLOWS_SPEC_FILE = "{text}" ;
26
+ assertFalse (pathUtil .isFile (WORKFLOWS_SPEC_FILE ));
27
+ }
28
+
17
29
}
You can’t perform that action at this time.
0 commit comments