From 141e86964e571e0700d9946d6db3b595d655401c Mon Sep 17 00:00:00 2001 From: reger24 <11603289+reger24@users.noreply.github.com> Date: Fri, 11 Feb 2022 00:27:55 +0100 Subject: [PATCH] Fix compile deprecation warning warning: [removal] AccessControlException in java.security has been deprecated and marked for removal --- .../net/yacy/cora/protocol/ftp/FTPClient.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/net/yacy/cora/protocol/ftp/FTPClient.java b/source/net/yacy/cora/protocol/ftp/FTPClient.java index 5a2cf3a42..fa04ac341 100644 --- a/source/net/yacy/cora/protocol/ftp/FTPClient.java +++ b/source/net/yacy/cora/protocol/ftp/FTPClient.java @@ -2509,20 +2509,18 @@ public class FTPClient { final String password, final boolean extended) { try { final FTPClient c = new FTPClient(); - c.cmd = new String[] { "open", host }; + c.cmd = new String[]{"open", host}; c.OPEN(); - c.cmd = new String[] { "user", account, password }; + c.cmd = new String[]{"user", account, password}; c.USER(); - c.cmd = new String[] { "ls" }; + c.cmd = new String[]{"ls"}; final List v = c.list(remotePath, extended); - c.cmd = new String[] { "close" }; + c.cmd = new String[]{"close"}; c.CLOSE(); - c.cmd = new String[] { "exit" }; + c.cmd = new String[]{"exit"}; c.EXIT(); return v; - } catch (final java.security.AccessControlException e) { - return null; - } catch (final IOException e) { + } catch (final SecurityException | IOException e) { return null; } } @@ -2536,7 +2534,7 @@ public class FTPClient { c.exec("ls", true); c.exec("close", false); c.exec("exit", false); - } catch (final java.security.AccessControlException e) { + } catch (final SecurityException e) { } } @@ -2782,7 +2780,7 @@ public class FTPClient { c.exec("get " + remoteFile + " " + localPath.getAbsoluteFile().toString(), false); c.exec("close", false); c.exec("exit", false); - } catch (final java.security.AccessControlException e) { + } catch (final SecurityException e) { } }