mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 12:35:22 +02:00
[221211] [api][breaking][files] need batch operations to indicate which operations were successful
This commit is contained in:
parent
60d0a65e99
commit
95da6330d1
1 changed files with 22 additions and 21 deletions
|
@ -397,7 +397,6 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
// transferSuccessful = true;
|
// transferSuccessful = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
|
// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
|
||||||
|
@ -426,11 +425,6 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
|
|
||||||
if (bufInputStream != null)
|
if (bufInputStream != null)
|
||||||
bufInputStream.close();
|
bufInputStream.close();
|
||||||
|
|
||||||
if (isCancelled)
|
|
||||||
{
|
|
||||||
throw new RemoteFileCancelledException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
|
@ -438,6 +432,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
throw new RemoteFileIOException(e);
|
throw new RemoteFileIOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isCancelled)
|
||||||
|
{
|
||||||
|
throw new RemoteFileCancelledException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -620,16 +619,18 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
if (bufInputStream != null)
|
if (bufInputStream != null)
|
||||||
bufInputStream.close();
|
bufInputStream.close();
|
||||||
|
|
||||||
if (isCancelled)
|
|
||||||
{
|
|
||||||
throw new RemoteFileCancelledException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
|
// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
|
||||||
throw new RemoteFileIOException(e);
|
throw new RemoteFileIOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCancelled)
|
||||||
|
{
|
||||||
|
throw new RemoteFileCancelledException();
|
||||||
|
}
|
||||||
|
|
||||||
if (totalBytes > 0)
|
if (totalBytes > 0)
|
||||||
{
|
{
|
||||||
|
@ -721,6 +722,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
{
|
{
|
||||||
dlistener.waitForUpdate();
|
dlistener.waitForUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (InterruptedException e)
|
catch (InterruptedException e)
|
||||||
{
|
{
|
||||||
// cancel monitor if it's still not cancelled
|
// cancel monitor if it's still not cancelled
|
||||||
|
@ -734,6 +736,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new RemoteFileIOException(e);
|
throw new RemoteFileIOException(e);
|
||||||
|
@ -841,7 +844,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
throw new RemoteFileIOException(e);
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2065,12 +2068,10 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
||||||
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
|
||||||
ICommonMessageIds.MSG_ERROR_UNEXPECTED,
|
ICommonMessageIds.MSG_ERROR_UNEXPECTED,
|
||||||
IStatus.ERROR,
|
IStatus.ERROR,
|
||||||
CommonMessages.MSG_ERROR_UNEXPECTED));
|
CommonMessages.MSG_ERROR_UNEXPECTED));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setReadOnly(String parent, String name,
|
public boolean setReadOnly(String parent, String name,
|
||||||
|
@ -2093,17 +2094,15 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
throw new RemoteFileIOException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
||||||
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
ICommonMessageIds.MSG_ERROR_UNEXPECTED,
|
||||||
ICommonMessageIds.MSG_ERROR_UNEXPECTED,
|
IStatus.ERROR,
|
||||||
IStatus.ERROR,
|
CommonMessages.MSG_ERROR_UNEXPECTED));
|
||||||
CommonMessages.MSG_ERROR_UNEXPECTED));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2128,6 +2127,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
getStatusMonitor(ds).waitForUpdate(status);
|
getStatusMonitor(ds).waitForUpdate(status);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
throw new RemoteFileIOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteEncoding = encodingElement.getValue();
|
remoteEncoding = encodingElement.getValue();
|
||||||
|
@ -2230,6 +2230,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
permissionsInt = accessInt; // leave permissions in decimal
|
permissionsInt = accessInt; // leave permissions in decimal
|
||||||
}
|
}
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
|
throw new RemoteFileIOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// user
|
// user
|
||||||
|
|
Loading…
Add table
Reference in a new issue