|
1 | 1 | /* |
2 | | - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
43 | 43 | import java.util.List; |
44 | 44 | import java.util.StringTokenizer; |
45 | 45 | import java.security.Permission; |
46 | | -import java.util.Properties; |
47 | 46 | import sun.net.NetworkClient; |
48 | 47 | import sun.net.util.IPAddressUtil; |
49 | 48 | import sun.net.www.MessageHeader; |
|
53 | 52 | import sun.net.ftp.FtpClient; |
54 | 53 | import sun.net.ftp.FtpProtocolException; |
55 | 54 | import sun.net.www.ParseUtil; |
56 | | -import sun.security.action.GetPropertyAction; |
57 | 55 |
|
58 | 56 |
|
59 | 57 | /** |
@@ -226,13 +224,7 @@ public synchronized void connect() throws IOException { |
226 | 224 | /** |
227 | 225 | * Do we have to use a proxy? |
228 | 226 | */ |
229 | | - @SuppressWarnings("removal") |
230 | | - ProxySelector sel = java.security.AccessController.doPrivileged( |
231 | | - new java.security.PrivilegedAction<ProxySelector>() { |
232 | | - public ProxySelector run() { |
233 | | - return ProxySelector.getDefault(); |
234 | | - } |
235 | | - }); |
| 227 | + ProxySelector sel = ProxySelector.getDefault(); |
236 | 228 | if (sel != null) { |
237 | 229 | URI uri = sun.net.www.ParseUtil.toURI(url); |
238 | 230 | final List<Proxy> proxies; |
@@ -293,10 +285,8 @@ public ProxySelector run() { |
293 | 285 |
|
294 | 286 | if (user == null) { |
295 | 287 | user = "anonymous"; |
296 | | - Properties props = GetPropertyAction.privilegedGetProperties(); |
297 | | - String vers = props.getProperty("java.version"); |
298 | | - password = props.getProperty("ftp.protocol.user", |
299 | | - "Java" + vers + "@"); |
| 288 | + String vers = System.getProperty("java.version"); |
| 289 | + password = System.getProperty("ftp.protocol.user", "Java" + vers + "@"); |
300 | 290 | } |
301 | 291 | try { |
302 | 292 | ftp = FtpClient.create(); |
|
0 commit comments