Commit 3d1f3c7f authored by Kristof Szabados's avatar Kristof Szabados
Browse files

pathVariableManager.resolvePath is deprectaed pushing us to use URIs instead of PATHs


Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent a518a5b6
......@@ -250,17 +250,18 @@ public class TITANResourceLocatorFieldEditor extends StringFieldEditor {
*/
private void handleBrowseButtonPressed() {
String selection = null;
final IPath resolvedPath = TITANPathUtilities.resolvePath(target, rootPath);
final URI resolvedPath = TITANPathUtilities.resolvePathURI(target, rootPath);
if (type == IResource.FILE) {
final FileDialog dialog = new FileDialog(getTextControl().getShell());
dialog.setText("Select the target file.");
dialog.setFilterPath(resolvedPath.removeLastSegments(1).toOSString());
Path path = new Path(resolvedPath.getPath());
dialog.setFilterPath(path.removeLastSegments(1).toOSString());
selection = dialog.open();
} else {
final DirectoryDialog dialog = new DirectoryDialog(getTextControl().getShell());
dialog.setMessage("Select the target folder.");
dialog.setFilterPath(resolvedPath.toOSString());
dialog.setFilterPath(resolvedPath.getPath());
selection = dialog.open();
}
if (selection != null) {
......@@ -284,10 +285,9 @@ public class TITANResourceLocatorFieldEditor extends StringFieldEditor {
return;
}
final IPath path = new Path(target);
final IPath resolvedPath = TITANPathUtilities.resolvePath(target, rootPath);
final URI uri = URIUtil.toURI(resolvedPath);
final String message = "Resolved location: " + uri.toString();
final URI path = URIUtil.toURI(target);
final URI resolvedPath = TITANPathUtilities.resolvePathURI(target, rootPath);
final String message = "Resolved location: " + resolvedPath.getPath();
resolvedPathLabelText.setText(message);
......
......@@ -84,16 +84,17 @@ public final class TITANPathUtilities {
*
* @return the resolved path.
* */
public static IPath resolvePath(final String pathToBeResolved, final String basePath) {
public static URI resolvePathURI(final String pathToBeResolved, final String basePath) {
final DebugPlugin debugPlugin = DebugPlugin.getDefault();
if (debugPlugin == null) {
ErrorReporter.logError("There was an error while resolving `" + pathToBeResolved + "'"
+ "the DebugPlugin was not yet initialized");
return new Path(pathToBeResolved);
return URI.create(pathToBeResolved);
}
final Map<?, ?> envVariables = debugPlugin.getLaunchManager().getNativeEnvironmentCasePreserved();
return resolvePath(pathToBeResolved, basePath, envVariables, ResourcesPlugin.getWorkspace().getPathVariableManager());
return resolvePathURI(pathToBeResolved, basePath, envVariables, ResourcesPlugin.getWorkspace().getPathVariableManager());
}
/**
......@@ -107,42 +108,24 @@ public final class TITANPathUtilities {
*
* @return the resolved path.
* */
public static IPath resolvePath(final String pathToBeResolved, final String basePath, final Map<?, ?> envVariables,
private static URI resolvePathURI(final String pathToBeResolved, final String basePath, final Map<?, ?> envVariables,
final IPathVariableManager pathVariableManager) {
final String tmp1 = EnvironmentVariableResolver.eclipseStyle().resolveIgnoreErrors(pathToBeResolved, envVariables);
final String tmp2 = EnvironmentVariableResolver.unixStyle().resolveIgnoreErrors(tmp1, envVariables);
final IPath path2 = new Path(tmp2);
IPath resolvedPath = pathVariableManager.resolvePath(path2);
if (basePath != null && !"".equals(basePath) && !resolvedPath.isAbsolute()) {
URI uri = URIUtil.toURI(tmp2);
URI resolvedURI = pathVariableManager.resolveURI(uri);
if (basePath != null && !"".equals(basePath) && !resolvedURI.isAbsolute()) {
final String temp = PathUtil.getAbsolutePath(basePath, tmp2);
if (temp != null) {
resolvedPath = new Path(temp);
resolvedURI = URIUtil.toURI(temp);
}
}
return resolvedPath;
return resolvedURI;
}
/**
* Resolves the provided path relative to the provided base path and
* returns the result as an URI.
*
* @param path
* the path to be resolved.
* @param rootPath
* the full path to which the resolvable one might be
* relative to.
*
* @return the resolved URI.
* */
public static URI getURI(final String path, final String rootPath) {
final IPath resolvedPath = resolvePath(path, rootPath);
return URIUtil.toURI(resolvedPath);
}
/**
* Converts the provided uri relative to the provided base uri
* Environment variables and path variables will not be resolved.
......
......@@ -147,19 +147,19 @@ public final class GenerateBuilderInformation extends AbstractHandler implements
node = document.createElement("workingDirectory");
// temp = TITANPathUtilities.resolvePath(temp,
// project.getLocation().toOSString()).toOSString();
node.appendChild(document.createTextNode(TITANPathUtilities.getURI(temp, project.getLocation().toOSString()).toString()));
node.appendChild(document.createTextNode(TITANPathUtilities.resolvePathURI(temp, project.getLocation().toOSString()).toString()));
makefileSettings.appendChild(node);
temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, "targetExecutable"));
node = document.createElement("targetExecutable");
// temp = TITANPathUtilities.resolvePath(temp,
// project.getLocation().toOSString()).toOSString();
node.appendChild(document.createTextNode(TITANPathUtilities.getURI(temp, project.getLocation().toOSString()).toString()));
node.appendChild(document.createTextNode(TITANPathUtilities.resolvePathURI(temp, project.getLocation().toOSString()).toString()));
makefileSettings.appendChild(node);
temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, "makefileUpdateScript"));
node = document.createElement("MakefileScript");
// temp = TITANPathUtilities.resolvePath(temp,
// project.getLocation().toOSString()).toOSString();
node.appendChild(document.createTextNode(TITANPathUtilities.getURI(temp, project.getLocation().toOSString()).toString()));
node.appendChild(document.createTextNode(TITANPathUtilities.resolvePathURI(temp, project.getLocation().toOSString()).toString()));
makefileSettings.appendChild(node);
temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, "makefileFlags"));
node = document.createElement("MakefileFlags");
......
......@@ -633,7 +633,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
new QualifiedName(ProjectBuildPropertyData.QUALIFIER, MakeAttributesData.TEMPORAL_MAKEFILE_SCRIPT_PROPERTY));
if (makefileScript != null && makefileScript.length() > 0) {
URI uri = TITANPathUtilities.getURI(makefileScript, getProject().getLocation().toOSString());
URI uri = TITANPathUtilities.resolvePathURI(makefileScript, getProject().getLocation().toOSString());
makefileScript = URIUtil.toPath(uri).toOSString();
List<String> command = new ArrayList<String>();
......@@ -816,7 +816,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
String targetExecutable = project.getPersistentProperty(
new QualifiedName(ProjectBuildPropertyData.QUALIFIER, MakefileCreationData.TARGET_EXECUTABLE_PROPERTY));
if (targetExecutable != null && targetExecutable.length() != 0) {
URI uri = TITANPathUtilities.getURI(targetExecutable, project.getLocation().toOSString());
URI uri = TITANPathUtilities.resolvePathURI(targetExecutable, project.getLocation().toOSString());
IPath path = URIUtil.toPath(uri);
path = path.removeLastSegments(1);
targetExecutable = path.toOSString();
......
......@@ -69,7 +69,7 @@ public final class TITANBuilderResourceDeltaVisitor implements IResourceDeltaVis
makefileScript = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER,
MakeAttributesData.TEMPORAL_MAKEFILE_SCRIPT_PROPERTY));
if (makefileScript != null) {
URI uri = TITANPathUtilities.getURI(makefileScript, project.getLocation().toOSString());
URI uri = TITANPathUtilities.resolvePathURI(makefileScript, project.getLocation().toOSString());
makefileScript = URIUtil.toPath(uri).toOSString();
}
} catch (CoreException e) {
......
......@@ -14,6 +14,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -779,8 +780,8 @@ public final class InternalMakefileGenerator {
} else {
String tempProjectLocation = location.toOSString();
for (String temp : optionList) {
IPath path = TITANPathUtilities.resolvePath(temp, tempProjectLocation);
temp = PathConverter.convert(path.toOSString(), reportDebugInformation,
URI uri = TITANPathUtilities.resolvePathURI(temp, tempProjectLocation);
temp = PathConverter.convert(uri.getPath(), reportDebugInformation,
TITANDebugConsole.getConsole());
contents.append(" -I").append(temp);
}
......@@ -833,8 +834,8 @@ public final class InternalMakefileGenerator {
} else {
String tempProjectLocation = location.toOSString();
for (String option : optionList) {
IPath path = TITANPathUtilities.resolvePath(option, tempProjectLocation);
option = PathConverter.convert(path.toOSString(), true, TITANDebugConsole.getConsole());
URI uri = TITANPathUtilities.resolvePathURI(option, tempProjectLocation);
option = PathConverter.convert(uri.getPath(), true, TITANDebugConsole.getConsole());
contents.append(" -I").append(option);
}
}
......@@ -2110,8 +2111,8 @@ public final class InternalMakefileGenerator {
} else {
String tempProjectLocation = location.toOSString();
for (String option : optionList) {
IPath path = TITANPathUtilities.resolvePath(option, tempProjectLocation);
option = PathConverter.convert(path.toOSString(), reportDebugInformation,
URI uri = TITANPathUtilities.resolvePathURI(option, tempProjectLocation);
option = PathConverter.convert(uri.getPath(), reportDebugInformation,
TITANDebugConsole.getConsole());
contents.append(' ').append(option);
}
......@@ -2136,8 +2137,8 @@ public final class InternalMakefileGenerator {
} else {
String tempProjectLocation = location.toOSString();
for (String temp : optionList) {
IPath path = TITANPathUtilities.resolvePath(temp, tempProjectLocation);
temp = PathConverter.convert(path.toOSString(), true, TITANDebugConsole.getConsole());
URI uri = TITANPathUtilities.resolvePathURI(temp, tempProjectLocation);
temp = PathConverter.convert(uri.getPath(), true, TITANDebugConsole.getConsole());
contents.append(" -L").append(temp);
}
}
......@@ -2242,8 +2243,8 @@ public final class InternalMakefileGenerator {
String temp = ResourceUtils.getPersistentProperty(project, ProjectBuildPropertyData.QUALIFIER, MakefileCreationData.TARGET_EXECUTABLE_PROPERTY);
if (temp != null && temp.trim().length() > 0) {
IPath resolvedPath = TITANPathUtilities.resolvePath(temp, projectLocation);
etsName = PathConverter.convert(resolvedPath.toOSString(), reportDebugInformation, TITANDebugConsole.getConsole());
URI resolvedURI = TITANPathUtilities.resolvePathURI(temp, projectLocation);
etsName = PathConverter.convert(resolvedURI.getPath(), reportDebugInformation, TITANDebugConsole.getConsole());
} else {
temp = project.getName();
if (Platform.OS_WIN32.equals(Platform.getOS())) {
......
......@@ -14,8 +14,6 @@ import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.preference.PreferenceStore;
import org.eclipse.jface.preference.StringFieldEditor;
......@@ -373,7 +371,7 @@ public final class MakeAttributesTab {
return false;
}
URI uri = TITANPathUtilities.getURI(temporalMakefileScriptFileFieldEditor.getStringValue(), project.getLocation()
URI uri = TITANPathUtilities.resolvePathURI(temporalMakefileScriptFileFieldEditor.getStringValue(), project.getLocation()
.toOSString());
File file = URIUtil.toPath(uri).toFile();
......@@ -392,7 +390,7 @@ public final class MakeAttributesTab {
return false;
}
URI uri = TITANPathUtilities.getURI(workingDirFieldEditor.getStringValue(), project.getLocation().toOSString());
URI uri = TITANPathUtilities.resolvePathURI(workingDirFieldEditor.getStringValue(), project.getLocation().toOSString());
uri = uri.normalize();
if (project.getLocationURI().equals(uri)) {
page.setErrorMessage("The working directory of the project and its location can not be the same folder.");
......@@ -454,8 +452,8 @@ public final class MakeAttributesTab {
setProperty(project, MakeAttributesData.BUILD_LEVEL_PROPERTY, buildLevel.getText());
String temp = temporalMakefileScriptFileFieldEditor.getStringValue();
IPath path = new Path(temp);
IPath resolvedPath = TITANPathUtilities.resolvePath(temp, project.getLocation().toOSString());
URI path = URIUtil.toURI(temp);
URI resolvedPath = TITANPathUtilities.resolvePathURI(temp, project.getLocation().toOSString());
if (path.equals(resolvedPath)) {
temp = PathUtil.getRelativePath(project.getLocation().toOSString(), temp);
}
......@@ -464,8 +462,8 @@ public final class MakeAttributesTab {
temporalMakefileFlagsStringFieldEditor.getStringValue());
temp = workingDirFieldEditor.getStringValue();
path = new Path(temp);
resolvedPath = TITANPathUtilities.resolvePath(temp, project.getLocation().toOSString());
path = URIUtil.toURI(temp);
resolvedPath = TITANPathUtilities.resolvePathURI(temp, project.getLocation().toOSString());
if (path.equals(resolvedPath)) {
temp = PathUtil.getRelativePath(project.getLocation().toOSString(), temp);
}
......
......@@ -7,11 +7,12 @@
******************************************************************************/
package org.eclipse.titan.designer.properties.pages;
import java.net.URI;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.preference.PreferenceStore;
......@@ -461,8 +462,8 @@ public final class MakefileCreationTab {
setProperty(project, MakefileCreationData.DEFAULT_TARGET_PROPERTY, defaultTarget.getActualValue());
String temp = temporalTargetExecutableFileFieldEditor.getStringValue();
IPath path = new Path(temp);
IPath resolvedPath = TITANPathUtilities.resolvePath(temp, project.getLocation().toOSString());
URI path = URIUtil.toURI(temp);
URI resolvedPath = TITANPathUtilities.resolvePathURI(temp, project.getLocation().toOSString());
if (path.equals(resolvedPath)) {
temp = PathUtil.getRelativePath(project.getLocation().toOSString(), temp);
}
......
......@@ -160,7 +160,7 @@ public class TITANProjectExportWizard extends Wizard implements IExportWizard {
return false;
}
URI projectFileURI = TITANPathUtilities.getURI(projectFile, project.getLocation().toOSString());
URI projectFileURI = TITANPathUtilities.resolvePathURI(projectFile, project.getLocation().toOSString());
IPath projectFilePath = URIUtil.toPath(projectFileURI);
if( projectFilePath == null ) {
ErrorReporter.logError("Invalid target tpd file name. Use the Browse button to get a valid file path");
......
......@@ -7,6 +7,7 @@
******************************************************************************/
package org.eclipse.titan.executor.executors;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
......@@ -60,6 +61,7 @@ import org.eclipse.ui.progress.IProgressConstants;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Date;
import java.util.Formatter;
......@@ -247,7 +249,7 @@ public abstract class BaseExecutor {
//correct the testcase list
if (null != executablePath && executablePath.length() > 0 && testcaseRefreshOnStart) {
ExecutableCalculationHelper helper = BaseMainControllerTab.checkExecutable(configuration, project, new Path(executablePath));
ExecutableCalculationHelper helper = BaseMainControllerTab.checkExecutable(configuration, project, URIUtil.toURI(executablePath));
if (helper.executableFileIsValid && helper.executableIsExecutable) {
helper.availableTestcases.toArray(new String[helper.availableTestcases.size()]);
}
......@@ -280,7 +282,8 @@ public abstract class BaseExecutor {
private String resolvePathFromAttribute(ILaunchConfiguration configuration, String projectLocation, String attribute) throws CoreException {
String path = configuration.getAttribute(attribute, (String) null);
if (!isNullOrEmpty(path)) {
path = TITANPathUtilities.resolvePath(path, projectLocation).toOSString();
URI uri = TITANPathUtilities.resolvePathURI(path, projectLocation);
path = uri.getPath();
}
return path;
}
......@@ -521,31 +524,31 @@ public abstract class BaseExecutor {
command = controller.command();
command = command.replace(REPLACEABLEHOSTNAME, controller.host());
IPath path;
URI path;
boolean oldStyleWorkingDir = true;
if (actualProject == null) {
path = new Path(controller.workingdirectory());
path = URIUtil.toURI(controller.workingdirectory());
} else {
path = new Path(controller.workingdirectory());
path = URIUtil.toURI(controller.workingdirectory());
if (!path.isAbsolute()) {
oldStyleWorkingDir = false;
path = TITANPathUtilities.resolvePath(controller.workingdirectory(), actualProject.getLocation().toOSString());
path = TITANPathUtilities.resolvePathURI(controller.workingdirectory(), actualProject.getLocation().toOSString());
}
}
String workingDirResult = PathConverter.convert(oldStyleWorkingDir ? controller.workingdirectory() : path.toOSString(), true, TITANConsole.getConsole());
String workingDirResult = PathConverter.convert(oldStyleWorkingDir ? controller.workingdirectory() : path.getPath(), true, TITANConsole.getConsole());
command = command.replace(REPLACEABLEHOSTWORKIGNDIRECTORY, workingDirResult);
boolean oldStyleExecutable = true;
if (actualProject == null) {
path = new Path(controller.executable());
path = URIUtil.toURI(controller.executable());
} else {
path = new Path(controller.executable());
path = URIUtil.toURI(controller.executable());
if (!path.isAbsolute()) {
oldStyleExecutable = false;
path = TITANPathUtilities.resolvePath(controller.executable(), actualProject.getLocation().toOSString());
path = TITANPathUtilities.resolvePathURI(controller.executable(), actualProject.getLocation().toOSString());
}
}
String executableResult = PathConverter.convert(oldStyleExecutable ? controller.executable() : path.toOSString(), true, TITANConsole.getConsole());
String executableResult = PathConverter.convert(oldStyleExecutable ? controller.executable() : path.getPath(), true, TITANConsole.getConsole());
String result = PathUtil.getRelativePath(workingDirResult, executableResult);
if (!result.equals(executableResult)) {
result = "./" + result;
......
......@@ -13,12 +13,12 @@ import static org.eclipse.titan.executor.GeneralConstants.REPLACEABLEHOSTWORKIGN
import static org.eclipse.titan.executor.GeneralConstants.REPLACEABLEMCHOST;
import static org.eclipse.titan.executor.GeneralConstants.REPLACEABLEMCPORT;
import java.net.URI;
import java.net.UnknownHostException;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
......@@ -147,21 +147,21 @@ public final class HostControllerDialog extends Dialog {
String example = "example command: " + commandText.getText();
example = example.replace(REPLACEABLEHOSTNAME, hostNameText.getText());
IPath workingDirPath;
URI workingDirPath;
if (null == project) {
workingDirPath = new Path(workingdirectoryText.getStringValue());
workingDirPath = URIUtil.toURI(workingdirectoryText.getStringValue());
} else {
workingDirPath = TITANPathUtilities.resolvePath(workingdirectoryText.getStringValue(), project.getLocation().toOSString());
workingDirPath = TITANPathUtilities.resolvePathURI(workingdirectoryText.getStringValue(), project.getLocation().toOSString());
}
example = example.replace(REPLACEABLEHOSTWORKIGNDIRECTORY, workingDirPath.toOSString());
example = example.replace(REPLACEABLEHOSTWORKIGNDIRECTORY, workingDirPath.getPath());
IPath executablePath;
URI executablePath;
if (null == project) {
executablePath = new Path(executableText.getStringValue());
executablePath = URIUtil.toURI(executableText.getStringValue());
} else {
executablePath = TITANPathUtilities.resolvePath(executableText.getStringValue(), project.getLocation().toOSString());
executablePath = TITANPathUtilities.resolvePathURI(executableText.getStringValue(), project.getLocation().toOSString());
}
String path = PathUtil.getRelativePath(workingDirPath.toOSString(), executablePath.toOSString());
String path = PathUtil.getRelativePath(workingDirPath.getPath(), executablePath.getPath());
example = example.replace(REPLACEABLEHOSTEXECUTABLE, path);
String hostName;
......
......@@ -18,18 +18,18 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
......@@ -419,13 +419,13 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT
protected final void handleWorkingDirectoryModified() {
if (!EMPTY.equals(workingdirectoryText.getStringValue())) {
IProject project = getProject();
IPath path;
URI uri;
if (project == null) {
path = new Path(workingdirectoryText.getStringValue());
uri = URIUtil.toURI(workingdirectoryText.getStringValue());
} else {
path = TITANPathUtilities.resolvePath(workingdirectoryText.getStringValue(), getProject().getLocation().toOSString());
uri = TITANPathUtilities.resolvePathURI(workingdirectoryText.getStringValue(), getProject().getLocation().toOSString());
}
File file = path.toFile();
File file = new File(uri);
if (file.exists() && file.isDirectory()) {
workingDirectoryIsValid = true;
return;
......@@ -451,10 +451,10 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT
*
* @return the information extracted.
* */
public static ExecutableCalculationHelper checkExecutable(final ILaunchConfiguration configuration, final IProject project, final IPath executableFileName) {
public static ExecutableCalculationHelper checkExecutable(final ILaunchConfiguration configuration, final IProject project, final URI executableFileName) {
ExecutableCalculationHelper result = new ExecutableCalculationHelper();
File file = executableFileName.toFile();
File file = new File(executableFileName);
if (!file.exists() || !file.isFile()) {
return result;
}
......@@ -482,7 +482,7 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT
MessageConsoleStream stream = TITANConsole.getConsole().newMessageStream();
Process proc;
String exename = PathConverter.convert(executableFileName.toOSString(), true, TITANDebugConsole.getConsole());
String exename = PathConverter.convert(executableFileName.getPath(), true, TITANDebugConsole.getConsole());
StringBuilder lastParam = new StringBuilder(exename);
lastParam.append(" -v");
List<String> shellCommand;
......@@ -581,14 +581,14 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT
@Override
public void run() {
IProject project = getProject();
IPath path;
URI uri;
if (project == null) {
path = new Path(executableFileText.getStringValue());
uri = URIUtil.toURI(executableFileText.getStringValue());
} else {
path = TITANPathUtilities.resolvePath(executableFileText.getStringValue(), getProject().getLocation().toOSString());
uri = TITANPathUtilities.resolvePathURI(executableFileText.getStringValue(), getProject().getLocation().toOSString());
}
ExecutableCalculationHelper helper = checkExecutable(lastConfiguration, DynamicLinkingHelper.getProject(projectNameText.getText()), path);
ExecutableCalculationHelper helper = checkExecutable(lastConfiguration, DynamicLinkingHelper.getProject(projectNameText.getText()), uri);
executableFileIsValid = helper.executableFileIsValid;
executableIsExecutable = helper.executableIsExecutable;
executableIsForSingleMode = helper.executableIsForSingleMode;
......@@ -618,18 +618,18 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT
}
IProject project = getProject();
IPath path;
URI uri;
if (project == null) {
path = new Path(configurationFileText.getStringValue());
uri = URIUtil.toURI(configurationFileText.getStringValue());
} else {
path = TITANPathUtilities.resolvePath(configurationFileText.getStringValue(), getProject().getLocation().toOSString());
uri = TITANPathUtilities.resolvePathURI(configurationFileText.getStringValue(), getProject().getLocation().toOSString());
}
File file = path.toFile();
File file = new File(uri);
if (file.exists() && file.isFile()) {
exceptions.clear();
ConfigFileHandler configHandler = new ConfigFileHandler();
configHandler.readFromFile(path.toOSString());
configHandler.readFromFile(uri.getPath());
if (configHandler.parseExceptions().isEmpty()) {
Map<String, String> env = new HashMap<String, String>(System.getenv());
Map<String, String> tempEnvironmentalVariables;
......@@ -654,7 +654,7 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT
}
configurationFileIsValid = false;
exceptions.clear();
exceptions.add(new Exception("The path `" + path + "' does not seem to be correct."));
exceptions.add(new Exception("The path `" + uri.getPath() + "' does not seem to be correct."));
automaticExecuteSectionExecution.setEnabled(false);
}
......@@ -762,8 +762,8 @@ public abstract class BaseMainControllerTab extends AbstractLaunchConfigurationT