You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/03/18 00:11:34 UTC
svn commit: r638129 - in
/geronimo/server/trunk/framework/modules/geronimo-plugin/src:
main/java/org/apache/geronimo/system/plugin/
test/java/org/apache/geronimo/system/plugin/
test/resources/copyfiletest/repository/test/jar/
test/resources/copyfiletes...
Author: djencks
Date: Mon Mar 17 16:11:26 2008
New Revision: 638129
URL: http://svn.apache.org/viewvc?rev=638129&view=rev
Log:
GERONIMO-3927 Allow plugin installer to unpack non-empty directories and files from packed jars as well as unpacked cars
Added:
geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/
geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/1.0/
geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/1.0/jar-1.0.jar (with props)
Modified:
geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=638129&r1=638128&r2=638129&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Mon Mar 17 16:11:26 2008
@@ -1218,7 +1218,7 @@
if (start == -1) {
if (sourceFile.length() == 0 || sourceFile.endsWith("/")) {
if ("jar".equals(url.getProtocol())) {
- start = path.lastIndexOf("!/") + 2;
+ start = path.lastIndexOf("!/") + 2 + sourceFile.length();
} else {
start = path.length();
//this entry needs nothing done
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java?rev=638129&r1=638128&r2=638129&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java Mon Mar 17 16:11:26 2008
@@ -143,6 +143,27 @@
assertTrue(new File(dir, "emptydir1").exists());
assertTrue(new File(dir, "emptyfile1").exists());
}
+
+ public void testCopyFileFromJar() throws Exception {
+ artifact = new Artifact("test", "jar", "1.0", "jar");
+ testCopyFile();
+ }
+/* ZipEntry cannot detect an empty directory in a jar
+ public void testCopyEmptyDirFromJar() throws Exception {
+ artifact = new Artifact("test", "jar", "1.0", "jar");
+ testCopyEmptyDir();
+ }
+*/
+/* ZipEntry cannot detect an empty directory in a jar
+ public void testCopyDirFromJar() throws Exception {
+ artifact = new Artifact("test", "jar", "1.0", "jar");
+ testCopyDir();
+ }
+*/
+ public void testCopyDirsFromJar() throws Exception {
+ artifact = new Artifact("test", "jar", "1.0", "jar");
+ testCopyDirs();
+ }
private File checkCopy(CopyFileType copyFile) throws IOException {
installer.copyFile(copyFile, artifact);
Added: geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/1.0/jar-1.0.jar
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/1.0/jar-1.0.jar?rev=638129&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/1.0/jar-1.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/java-archive