I am creating a file like so
try {
File file = new File(workingDir, obj.getName() + ".xls");
outputStream = new FileOutputStream(file);
} catch (FileNotFoundException ex) {
ex.printStackTrace();
}
And I am getting
java.io.FileNotFoundException: ..\a\relative\path\obj_name.xls (The parameter is incorrect)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
What does "the parameter is incorrect" mean? The pathname I validated exists; shouldn't it just create the file name? This is on a windows machine. The code works without this error on unix based systems.
Update
Verified that the file exists that the output stream is attempting to write to. Also verified that the file is writable. After much fussing, I removed the actual path and just passed in the file name (not desired) and that works. So the issue has something to do with the path. Do I need to escape the characters in the path?