mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 05:55:22 +02:00
[189487] patch for xcopy provided by Xuan
This commit is contained in:
parent
72d52e2fcd
commit
f94acbec61
2 changed files with 25 additions and 6 deletions
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - Fix 154874 - handle files with space or $ in the name
|
* Martin Oberhuber (Wind River) - Fix 154874 - handle files with space or $ in the name
|
||||||
* Xuan Chen (IBM) - Fix 160768 - [refresh][dstore] Refresh on renamed node within a zip does not work;
|
* Xuan Chen (IBM) - Fix 160768 - [refresh][dstore] Refresh on renamed node within a zip does not work;
|
||||||
|
* Xuan Chen (IBM) - Fix 189487 - copy and paste a folder did not work - workbench hang
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.dstore.universal.miners;
|
package org.eclipse.rse.dstore.universal.miners;
|
||||||
|
@ -328,6 +329,18 @@ public class UniversalFileSystemMiner extends Miner {
|
||||||
// handle special characters in source and target strings
|
// handle special characters in source and target strings
|
||||||
src = enQuote(src);
|
src = enQuote(src);
|
||||||
|
|
||||||
|
// handle window case separately, since xcopy command could not handler
|
||||||
|
// multiple source names
|
||||||
|
if (_isWindows)
|
||||||
|
{
|
||||||
|
tgt = tgtFolder.getAbsolutePath() + File.separatorChar + srcFile.getName();
|
||||||
|
doCopyCommand(enQuote(src), enQuote(tgt), folderCopy, status);
|
||||||
|
if (status.getAttribute(DE.A_SOURCE) == IServiceConstants.FAILED)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (numOfNonVirtualSources == 0)
|
if (numOfNonVirtualSources == 0)
|
||||||
{
|
{
|
||||||
source += src;
|
source += src;
|
||||||
|
@ -356,7 +369,7 @@ public class UniversalFileSystemMiner extends Miner {
|
||||||
if (folderCopy) {
|
if (folderCopy) {
|
||||||
command = "xcopy " + source //$NON-NLS-1$
|
command = "xcopy " + source //$NON-NLS-1$
|
||||||
+ " " + tgt //$NON-NLS-1$
|
+ " " + tgt //$NON-NLS-1$
|
||||||
+ " /S /E /K /Q /H /I"; //$NON-NLS-1$
|
+ " /S /E /K /Q /H /I /Y"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
String unquotedTgt = tgt.substring(1, tgt.length() - 1);
|
String unquotedTgt = tgt.substring(1, tgt.length() - 1);
|
||||||
|
@ -3075,10 +3088,15 @@ private DataElement createDataElementFromLSString(DataElement subject,
|
||||||
String tgt = tgtFolder.getAbsolutePath() + File.separatorChar + newName;
|
String tgt = tgtFolder.getAbsolutePath() + File.separatorChar + newName;
|
||||||
File tgtFile = new File(tgt);
|
File tgtFile = new File(tgt);
|
||||||
|
|
||||||
if (tgtFile.exists() && tgtFile.isDirectory() && newName.equals(srcFile.getName()))
|
if (tgtFile.exists() && tgtFile.isDirectory())
|
||||||
|
{
|
||||||
|
//For Windows, we need to use xcopy command, which require the new directory
|
||||||
|
//name be part of the target.
|
||||||
|
if (newName.equals(srcFile.getName()) && !_isWindows)
|
||||||
{
|
{
|
||||||
tgt = tgtFolder.getAbsolutePath();
|
tgt = tgtFolder.getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
doCopyCommand(enQuote(src), enQuote(tgt), folderCopy, status);
|
doCopyCommand(enQuote(src), enQuote(tgt), folderCopy, status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* Martin Oberhuber (Wind River) - fix 168586 - isCaseSensitive() on Windows
|
* Martin Oberhuber (Wind River) - fix 168586 - isCaseSensitive() on Windows
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
* Kevin Doyle (IBM) - [182221] Throwing Proper Exceptions on create file/folder
|
* Kevin Doyle (IBM) - [182221] Throwing Proper Exceptions on create file/folder
|
||||||
|
* Xuan Chen (IBM) - Fix 189487 - copy and paste a folder did not work - workbench hang
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.services.local.files;
|
package org.eclipse.rse.internal.services.local.files;
|
||||||
|
@ -1110,7 +1111,7 @@ public class LocalFileService extends AbstractFileService implements IFileServic
|
||||||
{
|
{
|
||||||
if (folderCopy)
|
if (folderCopy)
|
||||||
{
|
{
|
||||||
command = "xcopy " + src + " " + target + " /S /E /K /Q /H /I"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
command = "xcopy " + src + " " + target + " /S /E /K /Q /H /I /Y"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1284,7 +1285,7 @@ public class LocalFileService extends AbstractFileService implements IFileServic
|
||||||
{
|
{
|
||||||
if (folderCopy)
|
if (folderCopy)
|
||||||
{
|
{
|
||||||
command = "xcopy " + src + " " + target + " /S /E /K /Q /H /I"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
command = "xcopy " + src + " " + target + " /S /E /K /Q /H /I /Y"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
command = _osCmdShell + "copy " + src + " " + target; //$NON-NLS-1$ //$NON-NLS-2$
|
command = _osCmdShell + "copy " + src + " " + target; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
Loading…
Add table
Reference in a new issue