Bug 464072 - [Search] Refresh on Access ignored during text search
Part one - org.eclipse.core.filesystem changes.
Change-Id: I49e8fb63021cae80cc9066aa819fd23d8fb8ad0e
diff --git a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/IFileStore.java b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/IFileStore.java
index 94f65c7..8638f23 100644
--- a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/IFileStore.java
+++ b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/IFileStore.java
@@ -8,7 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Martin Oberhuber (Wind River) - [170317] add symbolic link support to API
- *******************************************************************************/
+ * Sergey Prigogin (Google) - [464072] Refresh on Access ignored during text search
+******************************************************************************/
package org.eclipse.core.filesystem;
import java.io.InputStream;
@@ -399,11 +400,12 @@
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting and cancellation are not desired
* @return An input stream on the contents of this file.
- * @exception CoreException if this method fails. Reasons include:
+ * @exception CoreException if this method fails. The status code associated with exception
+ * reflects the cause of the failure. Reasons include:
* <ul>
- * <li>This store does not exist.</li>
- * <li>This store represents a directory.</li>
- * <li>The limit of concurrently opened streams has been exceeded.</li>
+ * <li>{@link EFS#ERROR_NOT_EXISTS} - This store does not exist.</li>
+ * <li>{@link EFS#ERROR_WRONG_TYPE} - This store represents a directory.</li>
+ * <li>{@link EFS#ERROR_READ} - The limit of concurrently opened streams has been exceeded.</li>
* </ul>
*/
public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException;
@@ -431,16 +433,16 @@
* and the new output will be written from the start of the file.
* </p>
*
- * @param options bit-wise or of option flag constants (
- * {@link EFS#APPEND}).
+ * @param options bit-wise or of option flag constants ({@link EFS#APPEND}).
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting and cancellation are not desired
* @return An output stream on the contents of this file.
- * @exception CoreException if this method fails. Reasons include:
+ * @exception CoreException if this method fails. The status code associated with exception
+ * reflects the cause of the failure. Reasons include:
* <ul>
- * <li>This store represents a directory.</li>
- * <li>The parent of this store does not exist.</li>
- * <li>The limit of concurrently opened streams has been exceeded.</li>
+ * <li>{@link EFS#ERROR_NOT_EXISTS} - This store does not exist.</li>
+ * <li>{@link EFS#ERROR_WRONG_TYPE} - This store represents a directory.</li>
+ * <li>{@link EFS#ERROR_READ} - The limit of concurrently opened streams has been exceeded.</li>
* </ul>
*/
public OutputStream openOutputStream(int options, IProgressMonitor monitor) throws CoreException;
diff --git a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java
index a575776..fe79674 100644
--- a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java
+++ b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java
@@ -7,9 +7,10 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Martin Oberhuber (Wind River) - [294429] Avoid substring baggage in FileInfo
- * Martin Lippert (VMware) - [394607] Poor performance when using findFilesForLocationURI
- * Sergey Prigogin (Google) - Fix for bug 435519
+ * Martin Oberhuber (Wind River) - [294429] Avoid substring baggage in FileInfo
+ * Martin Lippert (VMware) - [394607] Poor performance when using findFilesForLocationURI
+ * Sergey Prigogin (Google) - [433061] Deletion of project follows symbolic links
+ * [464072] Refresh on Access ignored during text search
*******************************************************************************/
package org.eclipse.core.internal.filesystem.local;
@@ -382,13 +383,16 @@
return new FileInputStream(file);
} catch (FileNotFoundException e) {
String message;
- if (!file.exists())
+ if (!file.exists()) {
message = NLS.bind(Messages.fileNotFound, filePath);
- else if (file.isDirectory())
+ Policy.error(EFS.ERROR_NOT_EXISTS, message, e);
+ } else if (file.isDirectory()) {
message = NLS.bind(Messages.notAFile, filePath);
- else
+ Policy.error(EFS.ERROR_WRONG_TYPE, message, e);
+ } else {
message = NLS.bind(Messages.couldNotRead, filePath);
- Policy.error(EFS.ERROR_READ, message, e);
+ Policy.error(EFS.ERROR_READ, message, e);
+ }
return null;
} finally {
monitor.done();
@@ -405,11 +409,13 @@
checkReadOnlyParent(file, e);
String message;
String path = filePath;
- if (file.isDirectory())
+ if (file.isDirectory()) {
message = NLS.bind(Messages.notAFile, path);
- else
+ Policy.error(EFS.ERROR_WRONG_TYPE, message, e);
+ } else {
message = NLS.bind(Messages.couldNotWrite, path);
- Policy.error(EFS.ERROR_WRITE, message, e);
+ Policy.error(EFS.ERROR_WRITE, message, e);
+ }
return null;
} finally {
monitor.done();