On Windows, getLocationURI().getPath() returns a string that
starts with "/C:/...". This does not get parsed correctly by
utilities like java.nio.file.Path.
Using getLocation().toOSString() instead solves this problem.
Change-Id: I7c5d6d43cd21fd9c0021105884f61fb32bd133d5
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/47932
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
final InputStream source = new ByteArrayInputStream(new byte[0]);
fResource.create(source, true, null);
}
- fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, fResource.getParent().getLocationURI().getPath());
+ fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, fResource.getParent().getLocation().toOSString());
}
@After
String supplFolderPath = getSupplementaryFileDir(trace);
IProject project = resource.getProject();
/* Remove the project's path from the supplementary path dir */
- if (!supplFolderPath.startsWith(project.getLocationURI().getPath())) {
+ if (!supplFolderPath.startsWith(project.getLocation().toOSString())) {
Activator.logWarning(String.format("Supplementary files folder for trace %s is not within the project.", trace.getName())); //$NON-NLS-1$
return;
}
IFolder supplFolder = prepareTraceSupplementaryFolder(getSupplementaryFolderPath(), true);
try {
- fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, supplFolder.getLocationURI().getPath());
+ fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, supplFolder.getLocation().toOSString());
} catch (CoreException e) {
Activator.getDefault().logError("Error setting persistant property " + TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, e); //$NON-NLS-1$
}