You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mb...@apache.org on 2007/04/23 09:53:04 UTC

svn commit: r531366 - in /incubator/uima/uimaj/trunk/uimaj-core/src/main: java/org/apache/uima/pear/tools/PackageCreator.java resources/org/apache/uima/pear/pear_messages.properties

Author: mbaessler
Date: Mon Apr 23 00:52:57 2007
New Revision: 531366

URL: http://svn.apache.org/viewvc?view=rev&rev=531366
Log:
UIMA-377

add additional classpath checking if ";" is used as path separator and not ":" 

JIRA ticket https://issues.apache.org/jira/browse/UIMA-377

Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/pear/tools/PackageCreator.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/resources/org/apache/uima/pear/pear_messages.properties

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/pear/tools/PackageCreator.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/pear/tools/PackageCreator.java?view=diff&rev=531366&r1=531365&r2=531366
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/pear/tools/PackageCreator.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/pear/tools/PackageCreator.java Mon Apr 23 00:52:57 2007
@@ -140,15 +140,23 @@
 
     // add classpath setting to the installation descriptor
     if (classpath != null) {
-      InstallationDescriptor.ActionInfo actionInfo = new InstallationDescriptor.ActionInfo(
-              InstallationDescriptor.ActionInfo.SET_ENV_VARIABLE_ACT);
-      actionInfo.params.put(InstallationDescriptorHandler.VAR_NAME_TAG,
-              InstallationController.CLASSPATH_VAR);
-      actionInfo.params.put(InstallationDescriptorHandler.VAR_VALUE_TAG, classpath);
-      String commentMessage = I18nUtil.localizeMessage(PEAR_MESSAGE_RESOURCE_BUNDLE,
-              "package_creator_env_setting", new Object[] { InstallationController.CLASSPATH_VAR });
-      actionInfo.params.put(InstallationDescriptorHandler.COMMENTS_TAG, commentMessage);
-      insd.addInstallationAction(actionInfo);
+      //classpath setting should use ";" as separator if it contains ":" as separator throw an exception.
+      if(classpath.indexOf(":") == -1) {
+        InstallationDescriptor.ActionInfo actionInfo = new InstallationDescriptor.ActionInfo(
+                InstallationDescriptor.ActionInfo.SET_ENV_VARIABLE_ACT);
+        actionInfo.params.put(InstallationDescriptorHandler.VAR_NAME_TAG,
+                InstallationController.CLASSPATH_VAR);
+        actionInfo.params.put(InstallationDescriptorHandler.VAR_VALUE_TAG, classpath);
+        String commentMessage = I18nUtil.localizeMessage(PEAR_MESSAGE_RESOURCE_BUNDLE,
+                "package_creator_env_setting", new Object[] { InstallationController.CLASSPATH_VAR });
+        actionInfo.params.put(InstallationDescriptorHandler.COMMENTS_TAG, commentMessage);
+        insd.addInstallationAction(actionInfo);  
+      }
+      else {
+        //throw an exception, classpath should only contain ";" as delimiter not ":"
+        throw new PackageCreatorException(PEAR_MESSAGE_RESOURCE_BUNDLE,
+                "error_package_creator_classpath_not_valid");
+      }     
     }
     
     // add datapath settings to the installation descriptor

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/resources/org/apache/uima/pear/pear_messages.properties
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/resources/org/apache/uima/pear/pear_messages.properties?view=diff&rev=531366&r1=531365&r2=531366
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/resources/org/apache/uima/pear/pear_messages.properties (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/resources/org/apache/uima/pear/pear_messages.properties Mon Apr 23 00:52:57 2007
@@ -37,4 +37,5 @@
 error_verify_installation = The following error occured during the installation verification of component {0}: {1}
 error_package_creator_invalid_directory = {0} is not a valid directory.
 error_package_creator_creating_pear_package = Error while creating the pear package for pear ID {0}
+error_package_creator_classpath_not_valid = Error while parsing the classapth settings. Use ';' as path separator.