mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[224576] fix: [api] Inconsistent boolean return values in SystemTarHandler
This commit is contained in:
parent
1097961ed2
commit
8e7398fe8b
1 changed files with 16 additions and 18 deletions
|
@ -23,6 +23,7 @@
|
||||||
* Xuan Chen (IBM) - [191370] [dstore] Supertransfer zip not deleted when cancelling copy
|
* Xuan Chen (IBM) - [191370] [dstore] Supertransfer zip not deleted when cancelling copy
|
||||||
* Xuan Chen (IBM) - [api] SystemTarHandler has inconsistent API
|
* Xuan Chen (IBM) - [api] SystemTarHandler has inconsistent API
|
||||||
* Johnson Ma (Wind River) - [195402][api] Add tar.gz archive support
|
* Johnson Ma (Wind River) - [195402][api] Add tar.gz archive support
|
||||||
|
* Xuan Chen (IBM) - [224576] [api] Inconsistent boolean return values in SystemTarHandler API
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.services.clientserver.archiveutils;
|
package org.eclipse.rse.services.clientserver.archiveutils;
|
||||||
|
@ -1248,8 +1249,8 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
|
|
||||||
// if it is an empty temp file, no need to recreate it
|
// if it is an empty temp file, no need to recreate it
|
||||||
if (children.length != 0) {
|
if (children.length != 0) {
|
||||||
boolean isCanceled = createTar(children, outStream, (HashSet)null, archiveOperationMonitor);
|
boolean ok = createTar(children, outStream, (HashSet)null, archiveOperationMonitor);
|
||||||
if (isCanceled)
|
if (!ok)
|
||||||
{
|
{
|
||||||
outStream.close();
|
outStream.close();
|
||||||
if (outputTempFile != null)
|
if (outputTempFile != null)
|
||||||
|
@ -1359,7 +1360,7 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
if (archiveOperationMonitor != null && archiveOperationMonitor.isCanceled())
|
if (archiveOperationMonitor != null && archiveOperationMonitor.isCanceled())
|
||||||
{
|
{
|
||||||
//the operation has been canceled
|
//the operation has been canceled
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
// if entry name is in the omit set, then do not include it
|
// if entry name is in the omit set, then do not include it
|
||||||
if (omitChildren != null && omitChildren.contains(children[i].fullName)) {
|
if (omitChildren != null && omitChildren.contains(children[i].fullName)) {
|
||||||
|
@ -1407,7 +1408,7 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
outStream.closeEntry();
|
outStream.closeEntry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1698,8 +1699,8 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
// add the virtual file to be replaced
|
// add the virtual file to be replaced
|
||||||
omissions.add(fullVirtualName);
|
omissions.add(fullVirtualName);
|
||||||
|
|
||||||
boolean isCanceled = createTar(children, outStream, omissions, archiveOperationMonitor);
|
boolean ok = createTar(children, outStream, omissions, archiveOperationMonitor);
|
||||||
if (isCanceled)
|
if (!ok)
|
||||||
{
|
{
|
||||||
outStream.close();
|
outStream.close();
|
||||||
if (outputTempFile != null)
|
if (outputTempFile != null)
|
||||||
|
@ -1822,8 +1823,8 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
omissions.add(omitArray[i].fullName);
|
omissions.add(omitArray[i].fullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isCanceled = createTar(children, outStream, omissions, archiveOperationMonitor);
|
boolean ok = createTar(children, outStream, omissions, archiveOperationMonitor);
|
||||||
if (isCanceled)
|
if (!ok)
|
||||||
{
|
{
|
||||||
outStream.close();
|
outStream.close();
|
||||||
if (outputTempFile != null)
|
if (outputTempFile != null)
|
||||||
|
@ -1990,8 +1991,8 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create tar with renamed entries
|
// create tar with renamed entries
|
||||||
boolean isCanceled = createTar(children, outStream, oldNewNames, archiveOperationMonitor);
|
boolean ok = createTar(children, outStream, oldNewNames, archiveOperationMonitor);
|
||||||
if (isCanceled)
|
if (!ok)
|
||||||
{
|
{
|
||||||
outStream.close();
|
outStream.close();
|
||||||
if (outputTempFile != null)
|
if (outputTempFile != null)
|
||||||
|
@ -2002,10 +2003,7 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true == isCanceled)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// close the output stream
|
// close the output stream
|
||||||
outStream.close();
|
outStream.close();
|
||||||
|
|
||||||
|
@ -2060,7 +2058,7 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
if (archiveOperationMonitor != null && archiveOperationMonitor.isCanceled())
|
if (archiveOperationMonitor != null && archiveOperationMonitor.isCanceled())
|
||||||
{
|
{
|
||||||
//the operation has been canceled
|
//the operation has been canceled
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
VirtualChild child = children[i];
|
VirtualChild child = children[i];
|
||||||
|
@ -2126,7 +2124,7 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2241,8 +2239,8 @@ public class SystemTarHandler implements ISystemArchiveHandler {
|
||||||
|
|
||||||
// if it is an empty temp file, no need to recreate it
|
// if it is an empty temp file, no need to recreate it
|
||||||
if (children.length != 0) {
|
if (children.length != 0) {
|
||||||
boolean isCanceled = createTar(children, outStream, (HashSet)null, archiveOperationMonitor);
|
boolean ok = createTar(children, outStream, (HashSet)null, archiveOperationMonitor);
|
||||||
if (isCanceled)
|
if (!ok)
|
||||||
{
|
{
|
||||||
outStream.close();
|
outStream.close();
|
||||||
if (outputTempFile != null)
|
if (outputTempFile != null)
|
||||||
|
|
Loading…
Add table
Reference in a new issue