Typically, what does it mean when java returns a “The parameter is incorrect”

前端 未结 6 465
名媛妹妹
名媛妹妹 2021-01-21 03:00

I am creating a file like so

try {
    File file = new File(workingDir, obj.getName() + \".xls\");
    outputStream = new FileOutputStream(file);
} catch (FileN         


        
6条回答
  •  感情败类
    2021-01-21 03:26

    Perhaps the application doesn't have the correct access to write to the file? Is it read-only or otherwise protected?

    FileOutputStream.open() is a native method, I would assume any sort of exception message such as "The parameter is incorrect" is coming from the underlying OS.

    BTW: the File constructor does not call FileOutputStream.open(), so is the exception not actually coming from the code you posted here?

提交回复
热议问题