// the launched process will fail
StringBuilder cmdline = new StringBuilder();
cmdline.append(RemoteLauncher.DESCRIPTOR_PARAM + " ");
String descriptorPath = configuration.getAttribute(LauncherConstants.ATTR_DESCRIPTOR_NAME, "");
IResource descriptor = ResourcesPlugin.getWorkspace().getRoot().findMember(descriptorPath);
ensureResourceExists(descriptor, "Analysis Engine Descritpor");
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);
ensureResourceExists(inputResource, "Input Resource");
cmdline.append(inputResource.getLocation().toOSString() + " ");
String formatName = configuration.getAttribute(LauncherConstants.ATTR_INPUT_FORMAT_NAME, " ");
cmdline.append(RemoteLauncher.INPUT_FORMAT_PARAM + " ");
cmdline.append(formatName + " ");
// if format equals PLAIN_TEXT
if (InputFormat.PLAIN_TEXT.toString().equals(formatName)) {
cmdline.append(RemoteLauncher.INPUT_ENCODING_PARAM + " ");
cmdline.append(configuration.getAttribute(LauncherConstants.ATTR_INPUT_ENCODING_NAME, "")
+ " ");
cmdline.append(RemoteLauncher.INPUT_LANGUAGE_PARAM + " ");
cmdline.append(configuration.getAttribute(LauncherConstants.ATTR_INPUT_LANGUAGE_NAME, "") + " ");
}
cmdline.append(RemoteLauncher.INPUT_RECURSIVE_PARAM + " ");
cmdline.append(configuration.getAttribute(LauncherConstants.ATTR_INPUT_RECURSIVELY_NAME, false) + " ");
String outputFolderPath = configuration.getAttribute(LauncherConstants.ATTR_OUTPUT_FOLDER_NAME, "");
// zero length string means that is is not set
if (outputFolderPath.length() != 0) {
IResource outputFolder = ResourcesPlugin.getWorkspace().getRoot().findMember(outputFolderPath);
ensureResourceExists(outputFolder, "Output Folder");
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 wrong
// it should be double checked
if (!(outputFolder instanceof IWorkspaceRoot || outputFolder instanceof IProject)) {