1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 14:25:37 +02:00

[209552] get rid of copy APIs to be clearer with download and upload

This commit is contained in:
David McKnight 2007-11-15 20:55:36 +00:00
parent c21bd772da
commit d9bba1a0af
3 changed files with 31 additions and 33 deletions

View file

@ -39,7 +39,6 @@
* Rupen Mardirossian (IBM) - [208435] added constructor to nested RenameRunnable class to take in names that are previously used as a parameter for multiple renaming instances
* David McKnight (IBM) - [209660] need to check if remote encoding has changed before using cached file
* Xuan Chen (IBM) - [160775] [api] [breaking] [nl] rename (at least within a zip) blocks UI thread
* Xuan Chen (IBM) - [209899] system view did not refresh properly if rename multiple folders in table view.
********************************************************************************/
package org.eclipse.rse.internal.files.ui.view;
@ -155,7 +154,6 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.IElementCollector;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.omg.PortableServer.AdapterActivator;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.NumberFormat;
@ -1473,10 +1471,10 @@ public class SystemViewRemoteFileAdapter
if (element instanceof IRemoteFile)
{
IRemoteFile srcFileOrFolder = (IRemoteFile) element;
return UniversalFileTransferUtility.copyRemoteResourceToWorkspace(srcFileOrFolder, monitor);
return UniversalFileTransferUtility.downloadResourceToWorkspace(srcFileOrFolder, monitor);
}
else if (element instanceof File) {
return UniversalFileTransferUtility.copyRemoteResourceToWorkspace((File)element, monitor);
return UniversalFileTransferUtility.downloadResourceToWorkspace((File)element, monitor);
}
else if (element instanceof IResource)
{
@ -1518,7 +1516,7 @@ public class SystemViewRemoteFileAdapter
{
//SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.copyRemoteResourcesToWorkspace(flatSet, monitor);
// for bug 209375, using multiple instead of single
SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.copyRemoteResourcesToWorkspaceMultiple(flatSet, monitor);
SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.downloadResourcesToWorkspaceMultiple(flatSet, monitor);
if (flatResult.hasMessage())
{
return flatResult;
@ -1547,7 +1545,7 @@ public class SystemViewRemoteFileAdapter
}
else
{
return UniversalFileTransferUtility.copyRemoteResourcesToWorkspace(set, monitor);
return UniversalFileTransferUtility.downloadResourcesToWorkspace(set, monitor);
}
}
@ -1845,11 +1843,11 @@ public class SystemViewRemoteFileAdapter
monitor.beginTask(_uploadMessage.getLevelOneText(), size);
}
// back to hierarchy
return UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)fromSet, targetFolder, monitor, true);
return UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)fromSet, targetFolder, monitor, true);
}
else
{
return UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)fromSet, targetFolder, monitor, true);
return UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)fromSet, targetFolder, monitor, true);
}
}
else if (fromSet instanceof SystemRemoteResourceSet)
@ -2212,7 +2210,7 @@ public class SystemViewRemoteFileAdapter
if (src instanceof IResource)
{
IResource srcFileOrFolder = (IResource) src;
return UniversalFileTransferUtility.copyWorkspaceResourceToRemote(srcFileOrFolder, targetFolder, monitor, true);
return UniversalFileTransferUtility.uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor, true);
}
}

View file

@ -119,7 +119,7 @@ public class FileServiceArchiveTest extends FileServiceBaseTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(localFss, srcAdapter3);
fromSet3.addResource(sourceFolderToCopy3);
ISystemResourceSet tempObjects3 = srcAdapter3.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, tempDir, mon, true);
//Then, we need to retrieve children of the tempDir to cache their information.
fss.resolveFilterString(tempDir, null, mon);
@ -350,14 +350,14 @@ public class FileServiceArchiveTest extends FileServiceBaseTest {
SystemRemoteResourceSet fromSet = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet.addResource(sourceFolderToCopy1);
ISystemResourceSet tempObjects1 = srcAdapter1.doDrag(fromSet, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects1, targetDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects1, targetDir, mon, true);
IRemoteFile sourceFolderToCopy2 = localFss.getRemoteFileObject(tempPath + '\\' + folderToCopyName2, mon);
ISystemDragDropAdapter srcAdapter2 = (ISystemDragDropAdapter) ((IAdaptable) sourceFolderToCopy2).getAdapter(ISystemDragDropAdapter.class);
SystemRemoteResourceSet fromSet2 = new SystemRemoteResourceSet(localFss, srcAdapter2);
fromSet2.addResource(sourceFolderToCopy2);
ISystemResourceSet tempObjects2 = srcAdapter2.doDrag(fromSet2, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects2, targetDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects2, targetDir, mon, true);
IRemoteFile zipSource1 = createFileOrFolder(inputFss, targetDir.getAbsolutePath(), zipSourceFileName1, false);
assertNotNull(zipSource1);
@ -567,7 +567,7 @@ public class FileServiceArchiveTest extends FileServiceBaseTest {
SystemRemoteResourceSet fromSet = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet.addResource(META_INF_folder);
ISystemResourceSet tempObjects1 = srcAdapter1.doDrag(fromSet, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
//now, copy org into the folder in the remote system
IRemoteFile org_folder = localFss.getRemoteFileObject(tempPath + '\\' + tarSourceForOpenFolderName2, mon);
@ -576,7 +576,7 @@ public class FileServiceArchiveTest extends FileServiceBaseTest {
SystemRemoteResourceSet fromSet2 = new SystemRemoteResourceSet(localFss, srcAdapter2);
fromSet2.addResource(org_folder);
ISystemResourceSet tempObjects2 = srcAdapter2.doDrag(fromSet2, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects2, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects2, tempDir, mon, true);
//now, create tar file in the host
IRemoteFile tarSource = createFileOrFolder(tempDir.getAbsolutePath(), tarSourceForOpenTest, false);
@ -1533,7 +1533,7 @@ public class FileServiceArchiveTest extends FileServiceBaseTest {
SystemRemoteResourceSet fromSet = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet.addResource(META_INF_folder);
ISystemResourceSet tempObjects1 = srcAdapter1.doDrag(fromSet, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
//now, copy org into the folder in the remote system
IRemoteFile org_folder = localFss.getRemoteFileObject(tempPath + '\\' + tarSourceFolderName2, mon);
@ -1542,7 +1542,7 @@ public class FileServiceArchiveTest extends FileServiceBaseTest {
SystemRemoteResourceSet fromSet2 = new SystemRemoteResourceSet(localFss, srcAdapter2);
fromSet2.addResource(org_folder);
ISystemResourceSet tempObjects2 = srcAdapter2.doDrag(fromSet2, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects2, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects2, tempDir, mon, true);
//now, create tar file in the host
IRemoteFile tarSource = createFileOrFolder(tempDir.getAbsolutePath(), tarSourceFileName1, false);

View file

@ -221,7 +221,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet3.addResource(sourceFolderToCopy1);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, tempDir, mon, true);
//Then, we need to retrieve children of the tempDir to cache their information.
Object[] children = fss.resolveFilterString(tempDir, null, mon);
@ -261,7 +261,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet1 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet1.addResource(sourceFolderToCopy1);
ISystemResourceSet tempObjects1 = srcAdapter1.doDrag(fromSet1, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
//Then, we need to retrieve children of the tempDir to cache their information.
fss.resolveFilterString(tempDir, null, mon);
@ -311,7 +311,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet2 = new SystemRemoteResourceSet(fss, srcAdapter2);
fromSet2.addResource(sourceFolderToCopy2);
ISystemResourceSet tempObjects2 = srcAdapter2.doDrag(fromSet2, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects2, dstoreWindowsTempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects2, dstoreWindowsTempDir, mon, true);
Object[] children = dstoreWindowsFss.resolveFilterString(dstoreWindowsTempDir, null, mon);
//Make sure there is no temp archive file left
@ -357,7 +357,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet1 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet1.addResource(sourceFolderToCopy1);
ISystemResourceSet tempObjects1 = srcAdapter1.doDrag(fromSet1, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects1, tempDir, mon, true);
//Then, we need to retrieve children of the tempDir to cache their information.
fss.resolveFilterString(tempDir, null, mon);
@ -385,7 +385,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet2 = new SystemRemoteResourceSet(fss, srcAdapter2);
fromSet2.addResource(sourceFolderToCopy2);
ISystemResourceSet tempObjects2 = srcAdapter2.doDrag(fromSet2, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects2, localTempDir, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects2, localTempDir, mon, true);
Object[] localChildren = localFss.resolveFilterString(localTempDir, null, mon);
//Make sure there is no temp archive file left
@ -449,7 +449,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(fss, srcAdapter1);
fromSet3.addResource(firstLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
//make sure some delay before checking the result
Thread.sleep(50);
@ -510,7 +510,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(fss, srcAdapter1);
fromSet3.addResource(secondLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
Thread.sleep(50);
@ -552,7 +552,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet3.addResource(firstLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
Object copiedVirtualFolder = getChildFromFolder(fss, folder1, folderToCopyName1);
@ -596,7 +596,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet3.addResource(secondLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, folder1, mon, true);
Object copiedVirtualFolder = getChildFromFolder(fss, folder1, secondLeveChildName);
@ -640,7 +640,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(fss, srcAdapter1);
fromSet3.addResource(firstLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
Thread.sleep(50);
Object copiedVirtualFolder = getChildFromFolder(localFss, destinationArchiveFile, folderToCopyName1);
@ -689,7 +689,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(fss, srcAdapter1);
fromSet3.addResource(secondLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
Thread.sleep(50);
@ -737,7 +737,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
fromSet3.addResource(firstLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
//The drop to the destination virtual folder in dstore connection.
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
//The result is in the dstore connection
Thread.sleep(50);
@ -789,7 +789,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet3.addResource(secondLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationArchiveFile, mon, true);
//The result is in the dstore connection
Thread.sleep(50);
@ -834,7 +834,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(fss, srcAdapter1);
fromSet3.addResource(firstLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
Thread.sleep(50);
Object copiedVirtualFolder = getChildFromFolder(localFss, destinationVirtualFolder, folderToCopyName1);
@ -883,7 +883,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(fss, srcAdapter1);
fromSet3.addResource(secondLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
Thread.sleep(50);
Object copiedVirtualFolder = getChildFromFolder(localFss, destinationVirtualFolder, secondLeveChildName);
@ -930,7 +930,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
fromSet3.addResource(firstLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
//The drop to the destination virtual folder in dstore connection.
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
//The result is in the dstore connection
Thread.sleep(50);
@ -982,7 +982,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
SystemRemoteResourceSet fromSet3 = new SystemRemoteResourceSet(localFss, srcAdapter1);
fromSet3.addResource(secondLevelChild);
ISystemResourceSet tempObjects3 = srcAdapter1.doDrag(fromSet3, mon);
UniversalFileTransferUtility.copyWorkspaceResourcesToRemote((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)tempObjects3, destinationVirtualFolder, mon, true);
//The result is in the dstore connection
Thread.sleep(50);