You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2022/11/25 08:16:56 UTC
[sling-org-apache-sling-tooling-support-install] branch master updated: releng: remove runtime dependency on commons-io
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-tooling-support-install.git
The following commit(s) were added to refs/heads/master by this push:
new 80307ba releng: remove runtime dependency on commons-io
80307ba is described below
commit 80307ba5d3053d81b831a52f55d09a95b3bab1f8
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Nov 25 09:16:50 2022 +0100
releng: remove runtime dependency on commons-io
---
pom.xml | 13 ++++++-------
.../sling/tooling/support/install/impl/InstallServlet.java | 9 +++------
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/pom.xml b/pom.xml
index cfdd967..06e72c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,13 +68,6 @@
<artifactId>org.osgi.service.component.annotations</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
-
<!-- embedded dependency -->
<dependency>
<groupId>org.apache.felix</groupId>
@@ -94,6 +87,12 @@
<version>4.8.1</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.11.0</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
diff --git a/src/main/java/org/apache/sling/tooling/support/install/impl/InstallServlet.java b/src/main/java/org/apache/sling/tooling/support/install/impl/InstallServlet.java
index e5ac14b..4e28275 100644
--- a/src/main/java/org/apache/sling/tooling/support/install/impl/InstallServlet.java
+++ b/src/main/java/org/apache/sling/tooling/support/install/impl/InstallServlet.java
@@ -37,7 +37,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.io.IOUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -221,11 +220,9 @@ public class InstallServlet extends HttpServlet {
} else {
final String entry = prefix + sourceFileOrDir.getFileName();
if (!JarFile.MANIFEST_NAME.equals(entry)) {
- try (InputStream fis = Files.newInputStream(sourceFileOrDir)) {
- final ZipEntry anEntry = new ZipEntry(entry);
- zos.putNextEntry(anEntry);
- IOUtils.copy(fis, zos);
- }
+ final ZipEntry anEntry = new ZipEntry(entry);
+ zos.putNextEntry(anEntry);
+ Files.copy(sourceFileOrDir, zos);
}
}
}