Lines 20-25
Link Here
|
20 |
* Kevin Doyle (IBM) - [195709] Windows Copying doesn't work when path contains space |
20 |
* Kevin Doyle (IBM) - [195709] Windows Copying doesn't work when path contains space |
21 |
* Kevin Doyle (IBM) - [196211] DStore Move tries rename if that fails copy/delete |
21 |
* Kevin Doyle (IBM) - [196211] DStore Move tries rename if that fails copy/delete |
22 |
* Xuan Chen (IBM) - [198046] [dstore] Cannot copy a folder into an archive file |
22 |
* Xuan Chen (IBM) - [198046] [dstore] Cannot copy a folder into an archive file |
|
|
23 |
* Xuan Chen (IBM) - [191367] with supertransfer on, Drag & Drop Folder from DStore to DStore doesn't work |
23 |
*******************************************************************************/ |
24 |
*******************************************************************************/ |
24 |
|
25 |
|
25 |
package org.eclipse.rse.dstore.universal.miners; |
26 |
package org.eclipse.rse.dstore.universal.miners; |
Lines 2256-2261
Link Here
|
2256 |
String newName = nameObj.getName(); |
2257 |
String newName = nameObj.getName(); |
2257 |
String targetType = targetFolder.getType(); |
2258 |
String targetType = targetFolder.getType(); |
2258 |
String srcType = sourceFile.getType(); |
2259 |
String srcType = sourceFile.getType(); |
|
|
2260 |
//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 |
2261 |
//default UNIVERSAL_FILTER_DESCRIPTOR since its information never been cached before. |
2262 |
//We need to find out its real type first before going to different if statement. |
2263 |
File srcFile = null; |
2264 |
VirtualChild child = null; |
2265 |
if (IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR == srcType) |
2266 |
{ |
2267 |
if (ArchiveHandlerManager.isVirtual(sourceFile.getValue())) |
2268 |
{ |
2269 |
String goodFullName = ArchiveHandlerManager.cleanUpVirtualPath(sourceFile.getValue()); |
2270 |
child = _archiveHandlerManager.getVirtualObject(goodFullName); |
2271 |
if (child.exists()) |
2272 |
{ |
2273 |
if (child.isDirectory) |
2274 |
{ |
2275 |
srcType = IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR; |
2276 |
} else |
2277 |
{ |
2278 |
srcType = IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR; |
2279 |
} |
2280 |
} |
2281 |
} |
2282 |
} |
2259 |
|
2283 |
|
2260 |
if (targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR) || targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { |
2284 |
if (targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR) || targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { |
2261 |
|
2285 |
|
Lines 2268-2291
Link Here
|
2268 |
return statusDone(status); |
2292 |
return statusDone(status); |
2269 |
} |
2293 |
} |
2270 |
|
2294 |
|
2271 |
File srcFile = null; |
|
|
2272 |
|
2273 |
if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR) |
2295 |
if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR) |
2274 |
|| srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR)) { |
2296 |
|| srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR)) { |
2275 |
|
2297 |
|
2276 |
srcFile = getFileFor(sourceFile); |
2298 |
srcFile = getFileFor(sourceFile); |
2277 |
} |
2299 |
} |
2278 |
else if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { |
2300 |
else if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { |
|
|
2301 |
ISystemArchiveHandler shandler = null; |
2302 |
if (null == child) |
2303 |
{ |
2304 |
AbsoluteVirtualPath svpath = getAbsoluteVirtualPath(sourceFile); |
2305 |
shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); |
2279 |
|
2306 |
|
2280 |
AbsoluteVirtualPath svpath = getAbsoluteVirtualPath(sourceFile); |
2307 |
if (shandler == null) { |
2281 |
ISystemArchiveHandler shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); |
2308 |
status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); |
2282 |
|
2309 |
return statusDone(status); |
2283 |
if (shandler == null) { |
2310 |
} |
2284 |
status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); |
2311 |
child = shandler.getVirtualFile(svpath.getVirtualPart()); |
2285 |
return statusDone(status); |
2312 |
} |
|
|
2313 |
else |
2314 |
{ |
2315 |
//If child is not null, it means the sourceFile is a type of UNIVERSAL_FILTER_DESCRIPTOR, and has already been handled |
2316 |
shandler = child.getHandler(); |
2286 |
} |
2317 |
} |
2287 |
|
|
|
2288 |
VirtualChild child = shandler.getVirtualFile(svpath.getVirtualPart()); |
2289 |
srcFile = child.getExtractedFile(); |
2318 |
srcFile = child.getExtractedFile(); |
2290 |
} |
2319 |
} |
2291 |
|
2320 |
|
Lines 2305-2321
Link Here
|
2305 |
} |
2334 |
} |
2306 |
} |
2335 |
} |
2307 |
else if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { |
2336 |
else if (srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) || srcType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) { |
|
|
2337 |
ISystemArchiveHandler shandler = null; |
2338 |
AbsoluteVirtualPath svpath = null; |
2339 |
if (null == child) |
2340 |
{ |
2341 |
svpath = getAbsoluteVirtualPath(sourceFile); |
2342 |
shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); |
2308 |
|
2343 |
|
2309 |
// extract from an archive to folder |
2344 |
if (shandler == null) { |
2310 |
AbsoluteVirtualPath svpath = getAbsoluteVirtualPath(sourceFile); |
2345 |
status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); |
2311 |
ISystemArchiveHandler shandler = getArchiveHandlerFor(svpath.getContainingArchiveString()); |
2346 |
return statusDone(status); |
2312 |
|
2347 |
} |
2313 |
if (shandler == null) { |
2348 |
child = shandler.getVirtualFile(svpath.getVirtualPart()); |
2314 |
status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); |
2349 |
} |
2315 |
return statusDone(status); |
2350 |
else |
|
|
2351 |
{ |
2352 |
//If child is not null, it means the sourceFile is a type of UNIVERSAL_FILTER_DESCRIPTOR, and has already been handled |
2353 |
shandler = child.getHandler(); |
2354 |
svpath = getAbsoluteVirtualPath(sourceFile.getValue()); |
2316 |
} |
2355 |
} |
2317 |
|
|
|
2318 |
VirtualChild child = shandler.getVirtualFile(svpath.getVirtualPart()); |
2319 |
|
2356 |
|
2320 |
File parentDir = getFileFor(targetFolder); |
2357 |
File parentDir = getFileFor(targetFolder); |
2321 |
File destination = new File(parentDir, newName); |
2358 |
File destination = new File(parentDir, newName); |
Lines 2329-2335
Link Here
|
2329 |
} |
2366 |
} |
2330 |
else { |
2367 |
else { |
2331 |
File tgtFolder = getFileFor(targetFolder); |
2368 |
File tgtFolder = getFileFor(targetFolder); |
2332 |
File srcFile = getFileFor(sourceFile); |
2369 |
srcFile = getFileFor(sourceFile); |
2333 |
|
2370 |
|
2334 |
// regular copy |
2371 |
// regular copy |
2335 |
boolean folderCopy = srcFile.isDirectory(); |
2372 |
boolean folderCopy = srcFile.isDirectory(); |