/**********************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.linuxtools.internal.tmf.ui.Activator;
-import org.eclipse.linuxtools.tmf.ui.project.model.TmfNavigatorContentProvider;
/**
* Import helper used to import traces
if (source.isDirectory()) {
IFolder folder = parentFolder.getFolder(targetName);
IStatus result = workspace.validateLinkLocation(folder, location);
- if (result.isOK()) {
+ if (result.isOK() || result.matches(IStatus.INFO | IStatus.WARNING)) {
folder.createLink(location, IResource.REPLACE, new NullProgressMonitor());
} else {
Activator.getDefault().logError(result.getMessage());
} else {
IFile file = parentFolder.getFile(targetName);
IStatus result = workspace.validateLinkLocation(file, location);
- if (result.isOK()) {
+ if (result.isOK() || result.matches(IStatus.INFO | IStatus.WARNING)) {
file.createLink(location, IResource.REPLACE,
new NullProgressMonitor());
} else {
Activator.getDefault().logError(result.getMessage());
}
}
- forceFolderRefresh(parentFolder);
res = parentFolder.findMember(targetName);
return res;
}
-
- /**
- * Refresh the folders to have sub-folders
- *
- * @param parentFolder
- * the folder to refresh
- */
- public static void forceFolderRefresh(IFolder parentFolder) {
- final TmfNavigatorContentProvider ncp = new TmfNavigatorContentProvider();
- // force the model to be populated
- ncp.getChildren(parentFolder.getProject());
- }
}