-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi, @DFedron.
I was able to reproduce the issue that the grading scripts encountered on a local build of your repository:
$ java -jar target/apptbook-2021.0.0.jar -textFile huidong/huidong.txt -print Project2 "This is Test 7" 01/07/2021 07:00 01/17/2021 17:00
Exception in thread "main" java.io.IOException: No such file or directory
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1024)
at edu.pdx.cs410J.huidong.Project2.constructPath(Project2.java:189)
at edu.pdx.cs410J.huidong.Project2.main(Project2.java:143)
I looked at the code and I think the problem is here:
PortlandStateJavaSummer2021/apptbook/src/main/java/edu/pdx/cs410J/huidong/Project2.java
Line 178 in f53009e
| File f1 = new File(this.getClass().getResource("").getPath()); |
When I ran the above command line with a debugger attached, I saw that the RealPath variable has more information than you probably intended:
I think all you need to do is create a new File(fileName) and it should work as expected.
Metadata
Metadata
Assignees
Labels
No labels
