Skip to content

Commit ac4b95d

Browse files
author
jantje
committed
#463 When creating linked folders use the pathVariables
1 parent 94e4eca commit ac4b95d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

io.sloeber.core/src/io/sloeber/core/tools/Helpers.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public static void LinkFolderToFolder(IProject project, IPath source, IPath targ
268268

269269
// create the actual link
270270
try {
271-
createNewFolder(project, target.toString(), URIUtil.toURI(source));
271+
createNewFolder(project, target.toString(), source);
272272
} catch (CoreException e) {
273273
Common.log(
274274
new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.Helpers_Create_folder_failed + target, e));
@@ -488,11 +488,14 @@ public static void addArduinoCodeToProject(IProject project, ICConfigurationDesc
488488
* @return nothing
489489
* @throws CoreException
490490
*/
491-
public static void createNewFolder(IProject Project, String newFolderName, URI linklocation) throws CoreException {
491+
public static void createNewFolder(IProject Project, String newFolderName, IPath linklocation)
492+
throws CoreException {
492493
// IPath newFolderPath = Project.getFullPath().append(newFolderName);
493494
final IFolder newFolderHandle = Project.getFolder(newFolderName);
494495
if (linklocation != null) {
495-
newFolderHandle.createLink(linklocation, IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
496+
URI relativeLinklocation = Project.getPathVariableManager().convertToRelative(URIUtil.toURI(linklocation),
497+
false, null);
498+
newFolderHandle.createLink(relativeLinklocation, IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
496499
} else {
497500
newFolderHandle.create(0, true, null);
498501
}

0 commit comments

Comments
 (0)