This is an automated email from the ASF dual-hosted git repository.

Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new cc9a69a29a refactor(admin): drop commons-io by replacing two 
IOUtils.copy call sites (#7607) (#7887)
cc9a69a29a is described below

commit cc9a69a29a0cffcab5dbff909fe0d42773dc0c34
Author: konlue <[email protected]>
AuthorDate: Wed Oct 21 10:53:25 2026 +0800

    refactor(admin): drop commons-io by replacing two IOUtils.copy call sites 
(#7607) (#7887)
---
 shenyu-admin/pom.xml                                                | 6 ------
 .../shenyu/admin/mode/cluster/filter/ClusterForwardFilter.java      | 4 ++--
 .../org/apache/shenyu/admin/service/impl/SandboxServiceImpl.java    | 4 ++--
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/shenyu-admin/pom.xml b/shenyu-admin/pom.xml
index 88cfe079a3..c8fabcea5c 100644
--- a/shenyu-admin/pom.xml
+++ b/shenyu-admin/pom.xml
@@ -285,12 +285,6 @@
             <artifactId>logging-interceptor</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>${commons-io.version}</version>
-        </dependency>
-
         <dependency>
             <groupId>io.micrometer</groupId>
             <artifactId>micrometer-registry-prometheus</artifactId>
diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/filter/ClusterForwardFilter.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/filter/ClusterForwardFilter.java
index 6e598b1dad..c719e837eb 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/filter/ClusterForwardFilter.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/filter/ClusterForwardFilter.java
@@ -23,7 +23,6 @@ import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shenyu.admin.config.properties.ClusterProperties;
 import org.apache.shenyu.admin.mode.cluster.service.ClusterSelectMasterService;
@@ -37,6 +36,7 @@ import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 import org.springframework.util.AntPathMatcher;
 import org.springframework.util.PathMatcher;
+import org.springframework.util.StreamUtils;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.filter.OncePerRequestFilter;
 import org.springframework.web.util.UriComponentsBuilder;
@@ -182,7 +182,7 @@ public class ClusterForwardFilter extends 
OncePerRequestFilter {
             response.setContentLength(body.length);
         }
         if (body.length > 0) {
-            IOUtils.copy(new ByteArrayInputStream(body), 
response.getOutputStream());
+            StreamUtils.copy(new ByteArrayInputStream(body), 
response.getOutputStream());
             response.getOutputStream().flush();
         } else {
             response.flushBuffer();
diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/SandboxServiceImpl.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/SandboxServiceImpl.java
index da9e819ddf..14e4d6fbcf 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/SandboxServiceImpl.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/SandboxServiceImpl.java
@@ -20,7 +20,6 @@ package org.apache.shenyu.admin.service.impl;
 import java.util.Set;
 import okhttp3.Response;
 import okhttp3.ResponseBody;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shenyu.admin.model.dto.ProxyGatewayDTO;
 import org.apache.shenyu.admin.model.entity.AppAuthDO;
@@ -39,6 +38,7 @@ import org.apache.shenyu.common.utils.JsonUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StreamUtils;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.util.UriComponents;
 import org.springframework.web.util.UriComponentsBuilder;
@@ -120,7 +120,7 @@ public class SandboxServiceImpl implements SandboxService {
                 response.addHeader("sandbox-sign", UriUtils.encode(sign, 
StandardCharsets.UTF_8));
             }
 
-            IOUtils.copy(body.byteStream(), response.getOutputStream());
+            StreamUtils.copy(body.byteStream(), response.getOutputStream());
             response.flushBuffer();
         }
     }

Reply via email to