diff options
Diffstat (limited to 'bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/provider/FileInfo.java')
-rw-r--r-- | bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/provider/FileInfo.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/provider/FileInfo.java b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/provider/FileInfo.java index 48e00e438..b27ac1a9b 100644 --- a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/provider/FileInfo.java +++ b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/provider/FileInfo.java @@ -34,6 +34,12 @@ public class FileInfo implements IFileInfo { private static final int ATTRIBUTE_EXISTS = 1 << 16; /** + * Internal attribute indicating that an I/O error was encountered while retrieving + * the file information. + */ + private static final int ATTRIBUTE_IO_ERROR = 1 << 17; + + /** * Bit field of file attributes. Initialized to specify a writable resource. */ private int attributes = EFS.ATTRIBUTE_OWNER_WRITE | EFS.ATTRIBUTE_OWNER_READ; @@ -113,6 +119,14 @@ public class FileInfo implements IFileInfo { return getAttribute(ATTRIBUTE_EXISTS); } + /** + * @since 1.4 + * @see IFileInfo#getError() + */ + public int getError() { + return getAttribute(ATTRIBUTE_IO_ERROR) ? IO_ERROR : NONE; + } + public boolean getAttribute(int attribute) { if (attribute == EFS.ATTRIBUTE_READ_ONLY && isAttributeSuported(EFS.ATTRIBUTE_OWNER_WRITE)) return (!isSet(EFS.ATTRIBUTE_OWNER_WRITE)) || isSet(EFS.ATTRIBUTE_IMMUTABLE); @@ -222,6 +236,20 @@ public class FileInfo implements IFileInfo { clear(ATTRIBUTE_EXISTS); } + /** + * Sets a flag indicating that an I/O error was encountered when accessing the file. + * + * @param value <code>true</code> if this file has an I/O error, and <code>false</code> + * otherwise. + * @since 1.4 + */ + public void setError(boolean value) { + if (value) + set(ATTRIBUTE_IO_ERROR); + else + clear(ATTRIBUTE_IO_ERROR); + } + /* (non-Javadoc) * @see org.eclipse.core.filesystem.IFileInfo#setLastModified(long) */ |