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 33import org .slf4j .Logger ;
44import org .slf4j .LoggerFactory ;
55
6+ import java .io .File ;
67import java .io .IOException ;
78import java .nio .file .Files ;
89import java .nio .file .Paths ;
@@ -21,4 +22,8 @@ public String getFromFile(String filepath) {
2122
2223 return content ;
2324 }
25+
26+ public boolean isFile (String filepath ) {
27+ return new File (filepath ).isFile ();
28+ }
2429}
Original file line number Diff line number Diff line change @@ -14,4 +14,16 @@ void getFromFile() {
1414 assertFalse (pathUtil .getFromFile (WORKFLOWS_SPEC_FILE ).isEmpty ());
1515 }
1616
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+
1729}
You can’t perform that action at this time.
0 commit comments