portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r719530 - /portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
Date Fri, 21 Nov 2008 08:02:16 GMT
Author: woonsan
Date: Fri Nov 21 00:02:15 2008
New Revision: 719530

URL: http://svn.apache.org/viewvc?rev=719530&view=rev
Log:
Jeroen Hoffman provided thie patch after he discovered some code in JetspeedSerializerApplicationImpl
from the db-tools subproject that is not working, when command line arguments are parsed.
First, at one point there is an "else if" needed instead of an "if" and second, the checks
and the actual command afterwards need to go outside of the argument parsing loop.
Thanks and cheers!

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java?rev=719530&r1=719529&r2=719530&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
Fri Nov 21 00:02:15 2008
@@ -68,7 +68,7 @@
         {
             if (args[n].equals("-c"))
                 categories = args[++n];
-            if (args[n].equals("-p"))
+            else if (args[n].equals("-p"))
                 propertyFileName = args[++n];
             else if (args[n].equals("-a"))
                 applicationRootPath = args[++n];
@@ -90,34 +90,35 @@
             {
                 throw new IllegalArgumentException("Unknown argument: " + args[n]);
             }
+        }
         
-            if ((!doImport) && (!doExport))
-            {
-              throw new IllegalArgumentException("Either import or export have to be defined
(-I or -E followed by the filename");
-            }
+        if ((!doImport) && (!doExport))
+        {
+          throw new IllegalArgumentException("Either import or export have to be defined
(-I or -E followed by the filename");
+        }
 
-            if ((doImport) && (doExport))
-            {
-                throw new IllegalArgumentException("Only one - either import or export -
can be requested");
-            }
-            
-            if (categories == null)
-            {
-                throw new IllegalArgumentException("Argument -c defining the assembly categories
filters (or the propertyFile key to it) is required");
-            }
-            
-            if (applicationRootPath == null)
-            {
-                throw new IllegalArgumentException("Argument -a specifying the path to (web)application
root, is required");
-            }
-            if (doImport)
-            {
-                app.importFiles(logger, applicationRootPath, categories, propertyFileName,
null, getTokens(fileName));
-            }
-            else if (doExport)
-            {
-                app.export(logger, applicationRootPath, categories, propertyFileName, null,
fileName, exportName);
-            }
+        if ((doImport) && (doExport))
+        {
+            throw new IllegalArgumentException("Only one - either import or export - can
be requested");
+        }
+        
+        if (categories == null)
+        {
+            throw new IllegalArgumentException("Argument -c defining the assembly categories
filters (or the propertyFile key to it) is required");
+        }
+        
+        if (applicationRootPath == null)
+        {
+            throw new IllegalArgumentException("Argument -a specifying the path to (web)application
root, is required");
+        }
+        
+        if (doImport)
+        {
+            app.importFiles(logger, applicationRootPath, categories, propertyFileName, null,
getTokens(fileName));
+        }
+        else if (doExport)
+        {
+            app.export(logger, applicationRootPath, categories, propertyFileName, null, fileName,
exportName);
         }
     }
         



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message