This is an automated email from the ASF dual-hosted git repository.
pzampino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/master by this push:
new 2f0dc4382 KNOX-3174: Upgrade commons-io to 2.17, forbiddenapis to 3.8
(#1068)
2f0dc4382 is described below
commit 2f0dc43824d7255b2ce538ad58c5a87a6408588f
Author: hanicz <[email protected]>
AuthorDate: Tue Aug 5 19:03:20 2025 +0200
KNOX-3174: Upgrade commons-io to 2.17, forbiddenapis to 3.8 (#1068)
---
.../org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java | 6 +++---
.../knox/gateway/services/topology/impl/DefaultTopologyService.java | 2 +-
.../org/apache/knox/gateway/topology/monitor/db/LocalDirectory.java | 3 ++-
pom.xml | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git
a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
index 8cf39e3ba..02c711ac5 100644
---
a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
+++
b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
@@ -835,7 +835,7 @@ public class DefaultHaDispatchTest {
public void write( int b ) throws IOException {
throw new IOException( "unreachable-host" ); // Fail-over condition
}
- }).once();
+ }).atLeastOnce();
CloseableHttpClient mockHttpClient =
EasyMock.createNiceMock(CloseableHttpClient.class);
EasyMock.expect(mockHttpClient.execute(outboundRequest)).andReturn(inboundResponse).anyTimes();
@@ -965,7 +965,7 @@ public class DefaultHaDispatchTest {
public void write( int b ) throws IOException {
throw new IOException( "unreachable-host" ); // Fail-over condition
}
- }).once();
+ }).atLeastOnce();
CloseableHttpClient mockHttpClient =
EasyMock.createNiceMock(CloseableHttpClient.class);
EasyMock.expect(mockHttpClient.execute(outboundRequest)).andReturn(inboundResponse).anyTimes();
@@ -1105,7 +1105,7 @@ public class DefaultHaDispatchTest {
public void write( int b ) throws IOException {
throw new IOException( "unreachable-host" ); // Fail-over
condition
}
- }).once();
+ }).atLeastOnce();
CloseableHttpClient mockHttpClient =
EasyMock.createNiceMock(CloseableHttpClient.class);
EasyMock.expect(mockHttpClient.execute(outboundRequest)).andReturn(inboundResponse).anyTimes();
diff --git
a/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
b/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
index 07e0ee071..7629bd2ac 100644
---
a/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
+++
b/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
@@ -190,7 +190,7 @@ public class DefaultTopologyService extends
FileAlterationListenerAdaptor implem
//save the updated content in the file
FileUtils.write(topologyFile, updated, StandardCharsets.UTF_8);
- } catch (IOException e) {
+ } catch (Exception e) {
auditor.audit(Action.REDEPLOY, topology.getName(),
ResourceType.TOPOLOGY, ActionOutcome.FAILURE);
log.failedToRedeployTopology(topology.getName(), e);
}
diff --git
a/gateway-server/src/main/java/org/apache/knox/gateway/topology/monitor/db/LocalDirectory.java
b/gateway-server/src/main/java/org/apache/knox/gateway/topology/monitor/db/LocalDirectory.java
index c5a2c903e..08e300e99 100644
---
a/gateway-server/src/main/java/org/apache/knox/gateway/topology/monitor/db/LocalDirectory.java
+++
b/gateway-server/src/main/java/org/apache/knox/gateway/topology/monitor/db/LocalDirectory.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
import java.nio.file.Paths;
import java.util.Set;
import java.util.stream.Collectors;
@@ -61,7 +62,7 @@ public class LocalDirectory {
public String fileContent(String name) throws IOException {
try {
return FileUtils.readFileToString(file(name), CHARSET);
- } catch (FileNotFoundException e) {
+ } catch (NoSuchFileException | FileNotFoundException e) {
return null;
}
}
diff --git a/pom.xml b/pom.xml
index cbd397b1a..3dc66f306 100644
--- a/pom.xml
+++ b/pom.xml
@@ -184,7 +184,7 @@
<commons-compress.version>1.26.0</commons-compress.version>
<commons-configuration2.version>2.10.1</commons-configuration2.version>
<commons-digester3.version>3.2</commons-digester3.version>
- <commons-io.version>2.8.0</commons-io.version>
+ <commons-io.version>2.17.0</commons-io.version>
<commons-lang.version>2.6</commons-lang.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
<commons-logging.version>1.2</commons-logging.version>
@@ -205,7 +205,7 @@
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
<fastinfoset.version>1.2.18</fastinfoset.version>
<findsecbugs-plugin.version>1.11.0</findsecbugs-plugin.version>
- <forbiddenapis.version>3.1</forbiddenapis.version>
+ <forbiddenapis.version>3.8</forbiddenapis.version>
<frontend-maven-plugin.version>1.15.1</frontend-maven-plugin.version>
<gethostname4j.version>1.0.0</gethostname4j.version> <!-- See here:
https://github.com/mattsheppard/gethostname4j -->
<glassfish-jaxb.version>2.3.3</glassfish-jaxb.version>