ss: Move plugins to Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / project / model / TmfImportHelper.java
index d9123da9426d4c9de4de0e23ea17bb66f3a308d0..11ed7e41f4af440f1920d442a3257e6b6efa591d 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * 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
@@ -24,7 +24,6 @@ import org.eclipse.core.runtime.IPath;
 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
@@ -56,7 +55,7 @@ public class TmfImportHelper {
         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());
@@ -64,27 +63,14 @@ public class TmfImportHelper {
         } 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());
-    }
 }
This page took 0.02586 seconds and 5 git commands to generate.