### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.files.ui Index: src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java,v retrieving revision 1.53 diff -u -r1.53 UniversalFileTransferUtility.java --- src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java 8 Jun 2007 22:46:49 -0000 1.53 +++ src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java 9 Aug 2007 21:28:40 -0000 @@ -22,6 +22,7 @@ * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core * Xuan Chen (IBM) - [187548] Editor shows incorrect file name after renaming file on Linux dstore * David McKnight (IBM) - [191472] should not use super transfer with SSH/FTP Folder Copy and Paste + * Xuan Chen (IBM) - [191367] with supertransfer on, Drag & Drop Folder from DStore to DStore doesn't work ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -73,6 +74,7 @@ import org.eclipse.rse.services.files.RemoteFileSecurityException; import org.eclipse.rse.services.files.RemoteFolderNotEmptyException; import org.eclipse.rse.subsystems.files.core.SystemIFileProperties; +import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.model.SystemFileTransferModeRegistry; import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem; @@ -1480,6 +1482,13 @@ targetFS.copy(compressedFolder, newTargetParent, newTargetFolder.getName(), monitor); // delete the temp remote archive + //Since this archive file has never been cache before, a default filter DStore Element + //will be created before we send down "delete" commad to dstore server. Since "delete" + //command is not a registered command for a filter + //element, the delete command query will not be sent to dstore server. + //To overcome this problem, we need to do query on it first to cache + //its information so that it could be deleted properly. + targetFS.resolveFilterString(newPath + RemoteFileFilterString.SWITCH_NOSUBDIRS, monitor); targetFS.delete(remoteArchive, monitor); monitor.done(); #P org.eclipse.rse.services.dstore Index: miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java,v retrieving revision 1.18 diff -u -r1.18 UniversalFileSystemMiner.java --- miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java 9 Aug 2007 21:22:34 -0000 1.18 +++ miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java 9 Aug 2007 21:28:41 -0000 @@ -20,6 +20,7 @@ * Kevin Doyle (IBM) - [195709] Windows Copying doesn't work when path contains space * Kevin Doyle (IBM) - [196211] DStore Move tries rename if that fails copy/delete * Xuan Chen (IBM) - [198046] [dstore] Cannot copy a folder into an archive file + * Xuan Chen (IBM) - [191367] with supertransfer on, Drag & Drop Folder from DStore to DStore doesn't work *******************************************************************************/ package org.eclipse.rse.dstore.universal.miners; @@ -2256,6 +2257,29 @@ String newName = nameObj.getName(); String targetType = targetFolder.getType(); String srcType = sourceFile.getType(); + //In the case of super transfer, the source file is a virtual file/folder inside the temporary zip file, and its type information is set to + //default UNIVERSAL_FILTER_DESCRIPTOR since its information never been cached before. + //We need to find out its real type first before going to different if statement. + File srcFile = null; + VirtualChild child = null; + if (IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR == srcType) + { + if (ArchiveHandlerManager.isVirtual(sourceFile.getValue())) + { + String goodFullName = ArchiveHandlerManager.cleanUpVirtualPath(sourceFile.getValue()); + child = _archiveHandlerManager.getVirtualObject(goodFullName); + if (child.exists()) + { + if (child.isDirectory) + { + srcType = IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR; + } else + { + srcType = IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR; + } + } + } + } if (targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR) || targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { @@ -2268,24 +2292,29 @@ return statusDone(status); } - File srcFile = null; - if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR)) { srcFile = getFileFor(sourceFile); } else if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { + ISystemArchiveHandler shandler = null; + if (null == child) + { + AbsoluteVirtualPath svpath = getAbsoluteVirtualPath(sourceFile); + shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); - AbsoluteVirtualPath svpath = getAbsoluteVirtualPath(sourceFile); - ISystemArchiveHandler shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); - - if (shandler == null) { - status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); - return statusDone(status); + if (shandler == null) { + status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); + return statusDone(status); + } + child = shandler.getVirtualFile(svpath.getVirtualPart()); + } + else + { + //If child is not null, it means the sourceFile is a type of UNIVERSAL_FILTER_DESCRIPTOR, and has already been handled + shandler = child.getHandler(); } - - VirtualChild child = shandler.getVirtualFile(svpath.getVirtualPart()); srcFile = child.getExtractedFile(); } @@ -2305,17 +2334,25 @@ } } else if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { + ISystemArchiveHandler shandler = null; + AbsoluteVirtualPath svpath = null; + if (null == child) + { + svpath = getAbsoluteVirtualPath(sourceFile); + shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); - // extract from an archive to folder - AbsoluteVirtualPath svpath = getAbsoluteVirtualPath(sourceFile); - ISystemArchiveHandler shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); - - if (shandler == null) { - status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); - return statusDone(status); + if (shandler == null) { + status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); + return statusDone(status); + } + child = shandler.getVirtualFile(svpath.getVirtualPart()); + } + else + { + //If child is not null, it means the sourceFile is a type of UNIVERSAL_FILTER_DESCRIPTOR, and has already been handled + shandler = child.getHandler(); + svpath = getAbsoluteVirtualPath(sourceFile.getValue()); } - - VirtualChild child = shandler.getVirtualFile(svpath.getVirtualPart()); File parentDir = getFileFor(targetFolder); File destination = new File(parentDir, newName); @@ -2329,7 +2366,7 @@ } else { File tgtFolder = getFileFor(targetFolder); - File srcFile = getFileFor(sourceFile); + srcFile = getFileFor(sourceFile); // regular copy boolean folderCopy = srcFile.isDirectory(); #P org.eclipse.rse.subsystems.files.core Index: src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java,v retrieving revision 1.4 diff -u -r1.4 ISystemFilePreferencesConstants.java --- src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java 7 Jun 2007 16:10:34 -0000 1.4 +++ src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java 9 Aug 2007 21:28:41 -0000 @@ -13,7 +13,8 @@ * * Contributors: * {Name} (company) - description of contribution. - * David McKnight (IBM) - [191367] seeting supertransfer to be disabled by default + * David McKnight (IBM) - [191367] setting supertransfer to be disabled by default + * Xuan Chen (IBM) - [191367] setting supertransfer back to enabled by default *******************************************************************************/ package org.eclipse.rse.internal.subsystems.files.core; @@ -46,7 +47,7 @@ public static final int FILETRANSFERMODE_TEXT = 1; public static final String DEFAULT_SUPERTRANSFER_ARCHIVE_TYPE = "zip"; //$NON-NLS-1$ - public static final boolean DEFAULT_DOSUPERTRANSFER = false; + public static final boolean DEFAULT_DOSUPERTRANSFER = true; public static final int DEFAULT_DOWNLOAD_BUFFER_SIZE = 40;