Author: keith
Date: Tue Apr 29 02:11:08 2008
New Revision: 16319

Log:

Coppying the addressing jar over to the client repo as well


Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Tue Apr 29 02:11:08 2008
@@ -1055,32 +1055,45 @@
         File wsasModules = new File (wso2wsasHome, WSAS_MODULES_DIR);
         File[] modules = wsasModules.listFiles();
 
-        // Serach for the rampart module in the WSAS
+        // Serach for the rampart and addressing module in the WSAS
         String rampartFileName = null;
+        String addressingFileName = null;
         for (int i = 0; i < modules.length; i++) {
             File module = modules[i];
             String moduleName = module.getName();
             if (moduleName.startsWith(MashupConstants.RAMPART)) {
                 rampartFileName = moduleName;
-                break;
+            }
+            else if (moduleName.startsWith(MashupConstants.ADDRESSING)) {
+                addressingFileName = moduleName;
             }
         }
         File wsasRampartModule = new File(wsasModules, rampartFileName);
         File clientRampartModule = new File (modulesDir, rampartFileName);
 
-        // If the rampart module exits in the client repo then we can skip 
copying it
-        if (clientRampartModule.exists()) {
-            return;
-        }
+        File wsasAddressingModule = new File(wsasModules, addressingFileName);
+        File clientAddressingModule = new File (modulesDir, 
addressingFileName);
 
         // Here we copy over the rampart mar from the WSAS repository in to 
our new client side
         // repository
+        if (!clientRampartModule.exists()) {
+            copyZip(wsasRampartModule, clientRampartModule);
+        }
+
+        // Here we copy over the addressing mar from the WSAS repository in to 
our new client side
+        // repository
+        if (!clientAddressingModule.exists()) {
+            copyZip(wsasAddressingModule, clientAddressingModule);
+        }
+    }
+
+    private void copyZip(File originalFile, File destinationFile) throws 
DeploymentException {
         try {
             byte[] readBuffer = new byte[MashupConstants.BUFFER_SIZE];
             ZipOutputStream zipOutputStream =
-                    new ZipOutputStream(new 
FileOutputStream(clientRampartModule));
+                    new ZipOutputStream(new FileOutputStream(destinationFile));
             ZipInputStream zipInputStream =
-                    new ZipInputStream(new FileInputStream(wsasRampartModule));
+                    new ZipInputStream(new FileInputStream(originalFile));
             ZipEntry ze;
             while ((ze = zipInputStream.getNextEntry()) != null) {
                 if (ze.isDirectory())

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to