From 2ea629f3f2ae07de9cb92baac13497a789d16ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Bj=C3=B8rsn=C3=B8s?= Date: Thu, 8 May 2025 14:52:53 +0000 Subject: [PATCH] 8353440: Disable FTP fallback for non-local file URLs by default Reviewed-by: dfuchs --- .../java/net/doc-files/net-properties.html | 11 +++ .../www/protocol/file/FileURLConnection.java | 19 +++++ .../sun/net/www/protocol/file/Handler.java | 1 + .../sun/net/www/protocol/file/Handler.java | 1 + test/jdk/java/net/URL/OpenStream.java | 12 +-- .../protocol/file/NonLocalFtpFallback.java | 54 ++++++++++++-- .../file/NonLocalFtpFallbackDisabled.java | 73 +++++++++++++++++++ 7 files changed, 155 insertions(+), 16 deletions(-) create mode 100644 test/jdk/sun/net/www/protocol/file/NonLocalFtpFallbackDisabled.java diff --git a/src/java.base/share/classes/java/net/doc-files/net-properties.html b/src/java.base/share/classes/java/net/doc-files/net-properties.html index 684c90a8164..4b9b62f1ed8 100644 --- a/src/java.base/share/classes/java/net/doc-files/net-properties.html +++ b/src/java.base/share/classes/java/net/doc-files/net-properties.html @@ -169,6 +169,17 @@ to determine the proxy that should be used for connecting to a given URI.

globally through their user interface). Note that this property is checked only once at startup.

+ +

File URL stream protocol handler properties

+

The following properties are used to configure the handler for URLs with the {@code file://} scheme:

+

Misc HTTP URL stream protocol handler properties