1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

[303092] [efs] RSE portion to deal with FileSystemResourceManager makes second call to efs provider on exception due to cancel

This commit is contained in:
David McKnight 2010-02-17 17:19:54 +00:00
parent a32a34db40
commit a07302c69b
2 changed files with 17 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved.
* Copyright (c) 2006, 2010 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -23,6 +23,7 @@
* Timur Shipilov (Xored) - [224538] RSEFileStore.getParent() returns null for element which is not root of filesystem
* David McKnight (IBM) - [287185] EFS provider should interpret the URL host component as RSE connection name rather than a hostname
* David McKnight (IBM) - [291738] [efs] repeated queries to RSEFileStoreImpl.fetchInfo() in short time-span should be reduced
* Szymon Brandys (IBM) - [303092] [efs] RSE portion to deal with FileSystemResourceManager makes second call to efs provider on exception due to cancel
********************************************************************************/
package org.eclipse.rse.internal.efs;
@ -41,6 +42,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Bundle;
@ -315,9 +317,14 @@ public class RSEFileStore extends FileStore
* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor)
*/
public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException
{
return getImpl().openInputStream(options, monitor);
public InputStream openInputStream(int options, IProgressMonitor monitor)
throws CoreException {
try {
return getImpl().openInputStream(options, monitor);
} catch (OperationCanceledException ex) {
monitor.setCanceled(true);
return null; //empty input stream
}
}
/*

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved.
* Copyright (c) 2006, 2010 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -33,6 +33,7 @@
* Martin Oberhuber (Wind River) - [234026] Clarify IFileService#createFolder() Javadocs
* David McKnight (IBM) - [287185] EFS provider should interpret the URL host component as RSE connection name rather than a hostname
* David McKnight (IBM) - [291738] [efs] repeated queries to RSEFileStoreImpl.fetchInfo() in short time-span should be reduced
* Szymon Brandys (IBM) - [303092] [efs] RSE portion to deal with FileSystemResourceManager makes second call to efs provider on exception due to cancel
********************************************************************************/
package org.eclipse.rse.internal.efs;
@ -50,6 +51,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
@ -288,6 +290,9 @@ public class RSEFileStoreImpl extends FileStore
if (monitor==null) monitor=new NullProgressMonitor();
subSys.connect(monitor, false);
}
catch (OperationCanceledException e) {
throw e;
}
catch (Exception e) {
throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(),