else {
IPath baseRuntimePath = virtualResources[i].getRuntimePath();
referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
}
IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
if (virtualFile != null && virtualFile.exists()) {
IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
for (int j = 0; j < underlyingFiles.length; j++) {
if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].isAccessible()) {
return underlyingFiles[j].getFullPath();
}
}
}
else {
// http://bugs.eclipse.org/338751
IVirtualFolder virtualFolder = ComponentCore.createFolder(project, referenceRuntimePath);
if (virtualFolder != null && virtualFolder.exists()) {
IContainer[] underlyingFolders = virtualFolder.getUnderlyingFolders();
for (int j = 0; j < underlyingFolders.length; j++) {
if (underlyingFolders[j].getProject().equals(project) && underlyingFolders[j].isAccessible()) {
return underlyingFolders[j].getFullPath();
}
}
}
}
}
}
}
else {
IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
if (virtualFile != null && virtualFile.exists()) {
return virtualFile.getUnderlyingFile().getFullPath();
}
}
return null;
}