Summary: | [dnd] Copy and Paste across connections to a Drive doesn't work | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Kevin Doyle <kjdoyle> | ||||
Component: | RSE | Assignee: | Xuan Chen <xuanchen> | ||||
Status: | CLOSED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
Severity: | normal | ||||||
Priority: | P2 | CC: | dmcknigh, xuanchen | ||||
Version: | 2.0 | Flags: | dmcknigh:
review+
|
||||
Target Milestone: | 2.0.1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Kevin Doyle
2007-08-30 16:13:29 EDT
That's an ugly loss of functionality. Dave can you check this? I could see the following NPE on the console of my first workspace: java.lang.NullPointerException at org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility.copyWorkspaceResourcesToRemote(UniversalFileTransferUtility.java:1158) at org.eclipse.rse.internal.files.ui.view.SystemViewRemoteFileAdapter.doDrop(SystemViewRemoteFileAdapter.java:1777) at org.eclipse.rse.internal.ui.view.SystemDNDTransferRunnable.transferRSEResources(SystemDNDTransferRunnable.java:214) at org.eclipse.rse.internal.ui.view.SystemDNDTransferRunnable.runInWorkspace(SystemDNDTransferRunnable.java:589) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) The reason is in UniversalFileTransferUtility#copyWorkspaceResourcesToRemote() method, we do the following: boolean isTargetArchive = targetFolder.isArchive(); if (isTargetArchive && !targetFolder.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement()) return null; StringBuffer newPathBuf = new StringBuffer(targetFolder.getAbsolutePath()); if (isTargetArchive) { newPathBuf.append(ArchiveHandlerManager.VIRTUAL_SEPARATOR); } else { newPathBuf.append(targetFolder.getSeparatorChar()); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } In the case where the target folder is not a drive, targetFolder.getAbsolutePath() returns the full path without the last separator. But in the case of a drive, it returns "C:\\" So the new path with becomes "C:\\\\", which does not exist. To fix it, we need to check if the newPathBuf already ends with the separatorChar. If yes, we don't need to append it. The other thing I noticed is that copy a folder from one connection to an archive file in a different connection does not work. But that is the different issue. I will open a separate bug for it. Created attachment 77759 [details]
fix for the bug
I put in the following fix:
Check if the full path of the target folder already ends with the separator character of the file subsystem. If no, we will append the separator to the target folder path.
The fix looks good. I committed the fix. Verified fixed with 2.0.1RC1. |