geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r505475 - /geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Date Fri, 09 Feb 2007 20:12:32 GMT
Author: sppatel
Date: Fri Feb  9 12:12:32 2007
New Revision: 505475

URL: http://svn.apache.org/viewvc?view=rev&rev=505475
Log:
fix checking of jar entry as a "lib" entry and get the actual value of lib directory

Modified:
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&rev=505475&r1=505474&r2=505475
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Fri Feb  9 12:12:32 2007
@@ -499,17 +499,7 @@
             if (ConfigurationModuleType.EAR == applicationType && earFile != null)
{
             	//get the value of the library-directory element in spec DD
             	ApplicationType specDD = (ApplicationType) applicationInfo.getSpecDD();
-            	String libDir = null;
-            	//value 'lib' is used if element not set or ear does not contain a dd
-            	if(specDD == null || !specDD.isSetLibraryDirectory()) {
-            		libDir = "lib";
-            	} else {
-            		String value = specDD.getLibraryDirectory().getStringValue().trim();
-            		//only set if not empty value, empty value implies no library directory
-            		if(value.length() > 0) {
-            			libDir = value;
-            		}
-            	}
+            	String libDir = getLibraryDirectory(specDD);
                 for (Enumeration<JarEntry> e = earFile.entries(); e.hasMoreElements();)
{
                     ZipEntry entry = e.nextElement();
                     String entryName = entry.getName();
@@ -618,6 +608,17 @@
             }
         }
     }
+    
+	private String getLibraryDirectory(ApplicationType specDD) {
+		if(specDD == null || !specDD.isSetLibraryDirectory()) {
+			//value 'lib' is used if element not set or ear does not contain a dd
+			return "lib";
+		}
+		
+		//only set if not empty value, empty value implies no library directory
+		String value = specDD.getLibraryDirectory().getStringValue();
+		return value.trim().length() > 0 ? value : null;
+	}
 
     private void cleanupContext(EARContext earContext, File configurationDir) {
         List<ConfigurationData> configurations = new ArrayList<ConfigurationData>();
@@ -756,7 +757,7 @@
             				}
             				builder = getConnectorConfigBuilder();
             				moduleTypeName = "a connector";
-            			} else if(entry.getName().endsWith(".jar") && !entry.getName().startsWith("lib"))
{
+            			} else if(entry.getName().endsWith(".jar") && !isLibraryEntry(application,
entry)) {
             				try {
             					NestedJarFile moduleFile = new NestedJarFile(earFile, entry.getName());
             					if(moduleFile.getEntry("META-INF/application-client.xml") != null) {
@@ -913,6 +914,14 @@
             }
         }
     }
+    
+	private boolean isLibraryEntry(ApplicationType application, ZipEntry entry) {
+		String libDir = getLibraryDirectory(application);
+		if(libDir != null && entry.getName().startsWith(libDir)) {
+			return true;
+		}
+		return false;
+	}
 
     private void mapVendorPlans(GerApplicationType gerApplication, Map<String, Object>
altVendorDDs, JarFile earFile) throws DeploymentException {
         //build map from module path to alt vendor dd



Mime
View raw message