-
Sub-task
-
Resolution: Delivered
-
P4
-
25
The unspecified, but long-standing, fallback to FTP connections for non-local `file` URLs is disabled by default.
The method `URL::openConnection` called for non-local file URLs of the form `"file://server[/path]"`, where `server` is anything but `"localhost"`, no longer falls back to FTP and no longer returns an FTP URL Connection. A `MalformedURLException` is now thrown by the `URL::openConnection` method instead in such cases.
Code expecting the `URL::openConnection` to succeed, but expecting a delayed exception to be raised when actually using the connection, such as catching an `UnknownHostException` while reading streams, may need to be updated to handle the immediate rejection via `MalformedURLException` instead.
The legacy FTP fallback behavior can be reenabled by setting the system property `-Djdk.net.file.ftpfallback=true` on the `java` command line. Support for resolving non-local, existing UNC paths on Windows is not affected by this change.
The method `URL::openConnection` called for non-local file URLs of the form `"file://server[/path]"`, where `server` is anything but `"localhost"`, no longer falls back to FTP and no longer returns an FTP URL Connection. A `MalformedURLException` is now thrown by the `URL::openConnection` method instead in such cases.
Code expecting the `URL::openConnection` to succeed, but expecting a delayed exception to be raised when actually using the connection, such as catching an `UnknownHostException` while reading streams, may need to be updated to handle the immediate rejection via `MalformedURLException` instead.
The legacy FTP fallback behavior can be reenabled by setting the system property `-Djdk.net.file.ftpfallback=true` on the `java` command line. Support for resolving non-local, existing UNC paths on Windows is not affected by this change.