Community
Participate
Working Groups
Copying and Pasting a file from one connection to a Local drive doesn't work. Copy and Paste within Local to a Drive works though. Steps to Reproduce: 1. Create a connection. 2. Copy some file from that connection. 3. Go to your C:\ and try to paste. --> No error is shown, but the paste doesn't work. -----------Enter bugs above this line----------- TM 2.0.1 Testing installation : eclipse-SDK-3.3 RSE install : Dev Driver - java.runtime : Sun 1.5.0_11-b03 os.name: : Windows XP, Service Pack 2 ------------------------------------------------
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.