Skip to content

Commit 5ec4f51

Browse files
Merge pull request #12 from ParikshithKedilayaM/Nagarjun2
Handled file extension.
2 parents eb64ee4 + 478605b commit 5ec4f51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/edu/asu/ser502/App.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
public class App {
1717
public static void main(String[] args) {
1818
App app = new App();
19-
String path = args.length > 0 ? args[0] : "InputFile.txt";
19+
String path = args.length > 0 ? args[0] : "InputFile.spk";
2020
try {
21-
app.run(path);
21+
if(path.endsWith(".spk")) {
22+
app.run(path);
23+
} else
24+
throw new Exception("Invalid file type!");
2225
} catch(Exception e) {
2326
System.err.println(e.getMessage());
2427
}

0 commit comments

Comments
 (0)