RFR: 8223717: javafx printing: Support Specifying Print to File in the API [v3]

Phil Race prr at openjdk.java.net
Thu Jun 24 23:05:59 UTC 2021


On Thu, 24 Jun 2021 22:53:57 GMT, Scott Palmer <swpalmer at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/print/JobSettings.java line 474:
>> 
>>> 472:      * encoded name of a filesystem file, to which the platform printer
>>> 473:      * driver should spool the rendered print data.
>>> 474:      * <p>
>> 
>> Can you add a sentence indicating that the URL needs to be a `file:` URL? And indicate what happens if it isn't (I presume it is ignored)?
>
> As a potential user of this API I have to ask, why would this be a URL instead of a File or Path ?  Particularly if only "file:" URLs will be valid.  I can't think of a scenario where it won't always be an extra inconvenience to convert the path I have to a URL.

We aren't ignoring it .. its just handed on, so its going to be the same as the other non-writable case .. file could not be created .. printing error .. 
we could do some up-front validation if that seems like the way we want to go. This could I guess also check if the file is writeable .. but since the user can select a non-writable file location in the dialog I don't think we should do that part. In which case I wonder about the URL validation too ..

-------------

PR: https://git.openjdk.java.net/jfx/pull/543


More information about the openjfx-dev mailing list