diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemDNDTransferRunnable.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemDNDTransferRunnable.java index c04f7a18748..62087380b2e 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemDNDTransferRunnable.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemDNDTransferRunnable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2008 IBM Corporation and others. + * Copyright (c) 2002, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,6 +26,7 @@ * David McKnight (IBM) - [196166] [usability][dnd] Changing the sort order of hosts in the SystemView should work by drag & drop * David McKnight (IBM) - [248922] [dnd] display error message when copy operation hits exception * Radoslav Gerganov (ProSyst) - [231428] [files] NPE on canceling copy operation from remote host + * David McKnight (IBM) - [328148] Dropping resource onto Eclipse IFile causes RSEG1003U unexpected exception *******************************************************************************/ package org.eclipse.rse.internal.ui.view; @@ -34,6 +35,7 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.WorkspaceJob; @@ -363,6 +365,10 @@ public class SystemDNDTransferRunnable extends WorkspaceJob IResource res = (IResource)tempFile; try { + if (target instanceof IFile){ + // as per bug 328148, we should always use the parent of a file when it's a target + target = ((IFile)target).getParent(); + } IPath destPath = target.getFullPath(); destPath = destPath.append(res.getName());