public interface IFileInfo extends Comparable<IFileInfo>, Cloneable
IFileStore.fetchInfo(int, IProgressMonitor)
,
IFileStore.putInfo(IFileInfo, int, IProgressMonitor)
FileStore
Modifier and Type | Field and Description |
---|---|
static int |
IO_ERROR
The constant indicating that an I/O error was encountered while retrieving file information.
|
static int |
NONE
The constant indicating that file information was retrieved successfully.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Returns whether this file or directory exists.
|
boolean |
getAttribute(int attribute)
Returns the value of the specified attribute for this file.
|
int |
getError()
Checks whether an I/O error was encountered while accessing this file or directory.
|
long |
getLastModified()
Returns the last modified time for this file, or
EFS.NONE
if the file does not exist or the last modified time could not be computed. |
long |
getLength()
Returns the length of this file, or
EFS.NONE
if the file does not exist, or the length could not be computed. |
String |
getName()
Returns the name of this file.
|
String |
getStringAttribute(int attribute)
Returns the value of the specified attribute for this file.
|
boolean |
isDirectory()
Returns whether this file is a directory, or
false if this
file does not exist. |
void |
setAttribute(int attribute,
boolean value)
Sets the value of the specified attribute for this file info.
|
void |
setLastModified(long time)
Sets the last modified time for this file.
|
compareTo
static final int NONE
static final int IO_ERROR
boolean exists()
true
if this file exists, and false
if the file does not exist or an I/O error was encountered.int getError()
boolean getAttribute(int attribute)
EFS#ATTRIBUTE_*
constants. Returns false
if this file does not exist,
could not be accessed, or the provided attribute does not apply to this
file system.attribute
- The attribute to retrieve the value forIFileSystem.attributes()
String getStringAttribute(int attribute)
EFS#ATTRIBUTE_*
constants. Returns null
if this file does not exist,
could not be accessed, or the provided attribute does not apply to this
file system.attribute
- The kind of attribute to return. Currently only
EFS.ATTRIBUTE_LINK_TARGET
is supported.IFileSystem.attributes()
long getLastModified()
EFS.NONE
if the file does not exist or the last modified time could not be computed.
The time is represented as the number of Universal Time (UT) milliseconds since the epoch (00:00:00 GMT, January 1, 1970).
EFS.NONE
long getLength()
EFS.NONE
if the file does not exist, or the length could not be computed.
For directories, the return value is unspecified.EFS.NONE
String getName()
boolean isDirectory()
false
if this
file does not exist.true
if this file is a directory, and false
otherwise.void setAttribute(int attribute, boolean value)
EFS#ATTRIBUTE_*
constants.
Note that not all attributes are applicable in a given file system.
Users must call IFileStore.putInfo(IFileInfo, int, IProgressMonitor)
before changes made to this info take effect in an underlying file.
attribute
- The attribute to set the value forvalue
- the value of the specified attribute for this file.IFileSystem.attributes()
void setLastModified(long time)
EFS.NONE
indicates the file does not exist or the last modified time could not be computed.
Users must call IFileStore.putInfo(IFileInfo, int, IProgressMonitor)
before changes made to this info take effect in an underlying file.
time
- the last modified time for this file, or EFS.NONE
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.