You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2011/04/06 15:24:37 UTC

svn commit: r1089444 - /uima/uimaj/trunk/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/AnalysisEngineLaunchConfigurationDelegate.java

Author: joern
Date: Wed Apr  6 13:24:37 2011
New Revision: 1089444

URL: http://svn.apache.org/viewvc?rev=1089444&view=rev
Log:
UIMA-2100 Improved output folder handling

Modified:
    uima/uimaj/trunk/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/AnalysisEngineLaunchConfigurationDelegate.java

Modified: uima/uimaj/trunk/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/AnalysisEngineLaunchConfigurationDelegate.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/AnalysisEngineLaunchConfigurationDelegate.java?rev=1089444&r1=1089443&r2=1089444&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/AnalysisEngineLaunchConfigurationDelegate.java (original)
+++ uima/uimaj/trunk/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/AnalysisEngineLaunchConfigurationDelegate.java Wed Apr  6 13:24:37 2011
@@ -76,15 +76,16 @@ public class AnalysisEngineLaunchConfigu
     cmdline.append(RemoteLauncher.DESCRIPTOR_PARAM + " ");
     String descriptorPath = configuration.getAttribute(LauncherConstants.ATTR_DESCRIPTOR_NAME, "");
     IResource descriptor = ResourcesPlugin.getWorkspace().getRoot().findMember(descriptorPath);
+    // TODO: Potential NPE
     cmdline.append(descriptor.getLocation().toOSString() + " ");
     cmdline.append(RemoteLauncher.INPUT_RESOURCE_PARAM + " ");
     
     String inputResourcePath = configuration.getAttribute(LauncherConstants.ATTR_INPUT_NAME, "");
     IResource inputResource = ResourcesPlugin.getWorkspace().getRoot().findMember(inputResourcePath);
+    // TODO: Potential NPE
     cmdline.append(inputResource.getLocation().toOSString() + " ");
     
-    String formatName = configuration.getAttribute(LauncherConstants.ATTR_INPUT_FORMAT_NAME,
-           " "); 
+    String formatName = configuration.getAttribute(LauncherConstants.ATTR_INPUT_FORMAT_NAME, " "); 
     cmdline.append(RemoteLauncher.INPUT_FORMAT_PARAM + " ");
     cmdline.append(formatName + " ");
     
@@ -101,17 +102,19 @@ public class AnalysisEngineLaunchConfigu
     String outputFolderPath = configuration.getAttribute(LauncherConstants.ATTR_OUTPUT_FOLDER_NAME, "");
     if (outputFolderPath.length() != 0) {
       IResource outputFolder = ResourcesPlugin.getWorkspace().getRoot().findMember(outputFolderPath);
-    
-	  cmdline.append(RemoteLauncher.OUTPUT_FOLDER_PARAM + " ");
-	  cmdline.append(outputFolder.getLocation().toOSString() + " ");
-	  
-	  // Do not delete the output folder if it is the Workspace Root or a Project
-	  // It should not be possible to set it to one of both, but in case something goes
-	  // it should be double checked
-	  if (!(outputFolder instanceof IWorkspaceRoot || outputFolder instanceof IProject)) {
-		  cmdline.append(RemoteLauncher.OUTPUT_CLEAR_PARAM + " ");
-		  cmdline.append(configuration.getAttribute(LauncherConstants.ATTR_OUTPUT_CLEAR_NAME, false));
-	  }
+      
+      if (outputFolder != null) {
+		  cmdline.append(RemoteLauncher.OUTPUT_FOLDER_PARAM + " ");
+		  cmdline.append(outputFolder.getLocation().toOSString() + " ");
+		  
+		  // Do not delete the output folder if it is the Workspace Root or a Project
+		  // It should not be possible to set it to one of both, but in case something goes
+		  // it should be double checked
+		  if (!(outputFolder instanceof IWorkspaceRoot || outputFolder instanceof IProject)) {
+			  cmdline.append(RemoteLauncher.OUTPUT_CLEAR_PARAM + " ");
+			  cmdline.append(configuration.getAttribute(LauncherConstants.ATTR_OUTPUT_CLEAR_NAME, false));
+		  }
+      }
     }
     
     return cmdline.toString();