Lines 109-116
Link Here
|
109 |
public IFolder createLinkFolder(IPath externalFolderPath, boolean refreshIfExistAlready, IProgressMonitor monitor) throws CoreException { |
109 |
public IFolder createLinkFolder(IPath externalFolderPath, boolean refreshIfExistAlready, IProgressMonitor monitor) throws CoreException { |
110 |
IProject externalFoldersProject = createExternalFoldersProject(monitor); // run outside synchronized as this can create a resource |
110 |
IProject externalFoldersProject = createExternalFoldersProject(monitor); // run outside synchronized as this can create a resource |
111 |
IFolder result = addFolder(externalFolderPath, externalFoldersProject); |
111 |
IFolder result = addFolder(externalFolderPath, externalFoldersProject); |
|
|
112 |
// ensure that the folder is refreshed since the external project is open using BACKGROUND_REFRESH |
113 |
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=244979 |
114 |
result.refreshLocal(IResource.DEPTH_ZERO, monitor); |
112 |
if (!result.exists()) |
115 |
if (!result.exists()) |
113 |
result.createLink(externalFolderPath, IResource.ALLOW_MISSING_LOCAL, monitor); |
116 |
result.createLink(externalFolderPath, refreshIfExistAlready ? IResource.ALLOW_MISSING_LOCAL : (IResource.ALLOW_MISSING_LOCAL | IResource.BACKGROUND_REFRESH), monitor); |
114 |
else if (refreshIfExistAlready) |
117 |
else if (refreshIfExistAlready) |
115 |
result.refreshLocal(IResource.DEPTH_INFINITE, monitor); |
118 |
result.refreshLocal(IResource.DEPTH_INFINITE, monitor); |
116 |
return result; |
119 |
return result; |
Lines 163-169
Link Here
|
163 |
createExternalFoldersProject(project, monitor); |
166 |
createExternalFoldersProject(project, monitor); |
164 |
} |
167 |
} |
165 |
try { |
168 |
try { |
166 |
project.open(monitor); |
169 |
project.open(IResource.BACKGROUND_REFRESH/*https://bugs.eclipse.org/bugs/show_bug.cgi?id=244979*/, monitor); |
167 |
} catch (CoreException e1) { |
170 |
} catch (CoreException e1) { |
168 |
if (e1.getStatus().getCode() == IResourceStatus.FAILED_READ_METADATA) { |
171 |
if (e1.getStatus().getCode() == IResourceStatus.FAILED_READ_METADATA) { |
169 |
// workspace was moved (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=241400) |
172 |
// workspace was moved (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=241400) |
Lines 198-204
Link Here
|
198 |
createExternalFoldersProject(project, monitor); |
201 |
createExternalFoldersProject(project, monitor); |
199 |
} |
202 |
} |
200 |
} |
203 |
} |
201 |
project.open(monitor); |
204 |
project.open(IResource.BACKGROUND_REFRESH/*https://bugs.eclipse.org/bugs/show_bug.cgi?id=244979*/, monitor); |
202 |
} |
205 |
} |
203 |
} |
206 |
} |
204 |
return project; |
207 |
return project; |