mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-30 19:53:30 +02:00
[192741] Fix extract (copy, move) from archive if more than 1 level deep
This commit is contained in:
parent
dce2ff6b5d
commit
fd3a307707
2 changed files with 13 additions and 2 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.rse.services;singleton:=true
|
||||
Bundle-Version: 2.0.0.qualifier
|
||||
Bundle-Version: 2.0.1.qualifier
|
||||
Bundle-Activator: org.eclipse.rse.internal.services.Activator
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* Xuan Chen (IBM) - [192741] [Archives] Move a folder from within an Archive doesn't work if > 1 level deep
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.services.clientserver.archiveutils;
|
||||
|
@ -712,7 +713,17 @@ public class SystemZipHandler implements ISystemArchiveHandler
|
|||
File topFile = destination;
|
||||
String topFilePath = topFile.getAbsolutePath().replace('\\', '/');
|
||||
//if (!dir.equals(topFile.getName()))
|
||||
if (!topFilePath.endsWith(dir))
|
||||
String lastPortionOfDir = null;
|
||||
int lastSlashIndex = dir.lastIndexOf('/');
|
||||
if (-1 == lastSlashIndex)
|
||||
{
|
||||
lastPortionOfDir = dir;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastPortionOfDir = dir.substring(lastSlashIndex + 1);
|
||||
}
|
||||
if (!topFilePath.endsWith(lastPortionOfDir))
|
||||
{
|
||||
rename(dir, topFile.getName());
|
||||
dir = topFile.getName();
|
||||
|
|
Loading…
Add table
Reference in a new issue