|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.filesystem.provider.FileInfo
This class should be used by file system providers in their implementation
of API methods that return IFileInfo
objects.
This class is not intended to be subclassed by clients.
Constructor Summary | |
---|---|
FileInfo()
Creates a new file information object with default values. |
|
FileInfo(String name)
Creates a new file information object. |
Method Summary | |
---|---|
Object |
clone()
|
int |
compareTo(Object o)
|
boolean |
exists()
Returns whether this file or directory exists. |
boolean |
getAttribute(int attribute)
Returns the value of the specified attribute for this file. |
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, is a directory, 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 |
setDirectory(boolean value)
Sets whether this is a file or directory. |
void |
setExists(boolean value)
Sets whether this file or directory exists. |
void |
setLastModified(long value)
Sets the last modified time for this file. |
void |
setLength(long value)
Sets the length of this file. |
void |
setName(String name)
Sets the name of this file. |
void |
setStringAttribute(int attribute,
String value)
Sets or clears a String attribute, e.g. symbolic link target. |
String |
toString()
For debugging purposes only. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FileInfo()
public FileInfo(String name)
name
- The name of this fileMethod Detail |
public Object clone()
public int compareTo(Object o)
compareTo
in interface Comparable
public boolean exists()
IFileInfo
exists
in interface IFileInfo
true
if this file exists, and false
otherwise.public boolean getAttribute(int attribute)
IFileInfo
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.
getAttribute
in interface IFileInfo
attribute
- The attribute to retrieve the value for
IFileSystem.attributes()
public String getStringAttribute(int attribute)
IFileInfo
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.
getStringAttribute
in interface IFileInfo
attribute
- The kind of attribute to return. Currently only
EFS.ATTRIBUTE_LINK_TARGET
is supported.
IFileSystem.attributes()
public long getLastModified()
IFileInfo
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).
getLastModified
in interface IFileInfo
EFS.NONE
public long getLength()
IFileInfo
EFS.NONE
if the file does not exist, is a directory, or the length could not be computed.
getLength
in interface IFileInfo
EFS.NONE
public String getName()
IFileInfo
getName
in interface IFileInfo
public boolean isDirectory()
IFileInfo
false
if this
file does not exist.
isDirectory
in interface IFileInfo
true
if this file is a directory, and false
otherwise.public void setAttribute(int attribute, boolean value)
IFileInfo
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.
setAttribute
in interface IFileInfo
attribute
- The attribute to set the value forvalue
- the value of the specified attribute for this file.IFileSystem.attributes()
public void setDirectory(boolean value)
value
- true
if this is a directory, and false
if this is a file.public void setExists(boolean value)
value
- true
if this file exists, and false
otherwise.public void setLastModified(long value)
IFileInfo
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.
setLastModified
in interface IFileInfo
value
- the last modified time for this file, or EFS.NONE
public void setLength(long value)
EFS.NONE
indicates the file does not exist, is a directory, or the length could not be computed.
value
- the length of this file, or EFS.NONE
public void setName(String name)
name
- The file namepublic void setStringAttribute(int attribute, String value)
attribute
- The kind of attribute to set. Currently only
EFS.ATTRIBUTE_LINK_TARGET
is supported.value
- The String attribute, or null
to clear
the attributepublic String toString()
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.