# com.bea.ide.filesystem
IFile Interface

public interface IFile
extends `Comparable`

All Superinterfaces
  `Comparable`

## Field Summary

`public static final `String`` | `PATH_SEPARATOR` String
`public static final `String`` | `SEPARATOR` String

## Method Summary

`public boolean` | `canRead`() true if read permission is available
`public boolean` | `canWrite`() true if write permission is available
`public int` | `compareTo`(`File` file) compares this IFile to the given file and returns a value according to the Comparable interface
`public int` | `compareTo`(`IFile` file) compares this IFile to the given IFile and returns a value according to the Comparable interface
`public int` | `compareToExact`(`File` file) compares this IFile to the given file and returns a value according to the Comparable interface.
`public int` | `compareToExact`(`IFile` file) compares this IFile to the given IFile and returns a value according to the Comparable interface.
`public boolean` | `exists`() returns true if this IFile exists on disk.
`public boolean` | `existsExact`() returns true if this IFile exists and the URI it was constructed with is exactly the name on disk (that is, it's URI is the canonical URI).
`public `IFile`` | `getAbsoluteIFile`() returns an IFile created from the absolute URI for this IFile.
`public `URI`` | `getAbsoluteURI`() returns an absolute URI for this file
`public `IFile`` | `getCanonicalIFile`() returns an IFile created from the canonical URI for this IFile.
`public `URI`` | `getCanonicalURI`() returns the canonical URI representation of the this file.
`public `String`` | `getDisplayPath`() returns a user readable string that represents the full path of the file
`public `File`` | `getFile`() This function will return this IFile as a File *if*possible*.
`public `InputStream`` | `getInputStream`() an input stream for this file
`public `String`` | `getName`() returns the name portion of the file.
`public `String`` | `getNameExtension`(boolean withDot)
`public `IFile`` | `getParentIFile`() returns an IFile created from the parent URI for this IFile.
`public `URI`` | `getParentURI`() returns the URI of the parent of this IFile
`public `URI`` | `getURI`() returns a URI representing this file
`public boolean` | `isAbsolute`() returns true if this IFile has an absolute URI.
`public boolean` | `isArchive`() This holds iff the item is a non-directory that has contents.
`public boolean` | `isContainer`() This is true iff the file has contents.
`public boolean` | `isDirectory`() This holds iff the item is an actual directory and exists.
`public boolean` | `isFile`() This is true iff the file exists and is not a directory
`public boolean` | `isInArchive`() This holds iff the item is contained within an archive.
`public long` | `lastModified`() returns the last modified time of the file in system time (ms since some date)
`public long` | `length`() returns the length (in bytes) of the file
`public `String`[]` | `list`() This method lists the names of the files contained by this IFile.
`public `IFile`[]` | `listIFiles`() returns the list of IFiles contained by this IFile.
`public `IFile`[]` | `listIFiles`(`IFileFilter` filter) returns the list of IFiles contained by this IFile.
`public `URI`[]` | `listURIs`() returns the list of URIs contained by this IFile.

Methods from interface `java.lang.`Comparable``
`compareTo`

## Field Detail

### PATH_SEPARATOR

    public static final String PATH_SEPARATOR

### SEPARATOR

    public static final String SEPARATOR

## Method Detail

### canRead() Method

    public boolean canRead()

true if read permission is available

### canWrite() Method

    public boolean canWrite()

true if write permission is available

### compareTo(File) Method

    public int compareTo(File file)

compares this IFile to the given file and returns a value according to the Comparable interface

### compareTo(IFile) Method

    public int compareTo(IFile file)

compares this IFile to the given IFile and returns a value according to the Comparable interface

### compareToExact(File) Method

    public int compareToExact(File file)

compares this IFile to the given file and returns a value according to the Comparable interface. This comparison is made without canonicalizing, so files that are the technically the same (file1.getCanonicalURI().equals(file2.getCanonicalURI()) == true) may be ordered differently. For example this may be used on a case-insensitive file system to get case-sensitive ordering

### compareToExact(IFile) Method

    public int compareToExact(IFile file)

compares this IFile to the given IFile and returns a value according to the Comparable interface. This comparison is made without canonicalizing, so files that are the technically the same (file1.getCanonicalURI().equals(file2.getCanonicalURI()) == true) may be ordered differently. For example this may be used on a case-insensitive file system to get case-sensitive ordering

### exists() Method

    public boolean exists()

returns true if this IFile exists on disk.

### existsExact() Method

    public boolean existsExact()

returns true if this IFile exists and the URI it was constructed with is exactly the name on disk (that is, it's URI is the canonical URI).

### getAbsoluteIFile() Method

    public IFile getAbsoluteIFile()

returns an IFile created from the absolute URI for this IFile. The two IFiles are equal, but may have different default values. i.e. file.getAbsoluteURI() == file.getAbsoluteIFile().getURI()

### getAbsoluteURI() Method

    public URI getAbsoluteURI()

returns an absolute URI for this file

### getCanonicalIFile() Method

    public IFile getCanonicalIFile()

returns an IFile created from the canonical URI for this IFile. The two IFiles are equal, but may have different default values. i.e. file.getCanonicalURI() == file.getCanonicalIFile().getURI()

### getCanonicalURI() Method

    public URI getCanonicalURI()

returns the canonical URI representation of the this file. this trims directory notation like .. and . as well as adjusting case in case-insensitive file systems. Every file has exactly one canonical URI

### getDisplayPath() Method

    public String getDisplayPath()

returns a user readable string that represents the full path of the file

### getFile() Method

    public File getFile()

This function will return this IFile as a File *if*possible*. If this cannot be done it will return null. In particular, trying to find the file for an internal piece of a zip file will return null.

### getInputStream() Method

    public InputStream getInputStream()

an input stream for this file

### getName() Method

    public String getName()

returns the name portion of the file. This excludes any path specification

### getNameExtension(boolean) Method

    public String getNameExtension(boolean withDot)

### getParentIFile() Method

    public IFile getParentIFile()

returns an IFile created from the parent URI for this IFile.

### getParentURI() Method

    public URI getParentURI()

returns the URI of the parent of this IFile

### getURI() Method

    public URI getURI()

returns a URI representing this file

### isAbsolute() Method

    public boolean isAbsolute()

returns true if this IFile has an absolute URI. Note that file.getAbsoluteIFile().isAbsolute() == true

### isArchive() Method

    public boolean isArchive()

This holds iff the item is a non-directory that has contents.

### isContainer() Method

    public boolean isContainer()

This is true iff the file has contents. I.e., isContainer <-> isDirectory || isArchive

### isDirectory() Method

    public boolean isDirectory()

This holds iff the item is an actual directory and exists. Note this

### isFile() Method

    public boolean isFile()

This is true iff the file exists and is not a directory

### isInArchive() Method

    public boolean isInArchive()

This holds iff the item is contained within an archive. Returns false for the archive file itself.

### lastModified() Method

    public long lastModified()

returns the last modified time of the file in system time (ms since some date)

### length() Method

    public long length()

returns the length (in bytes) of the file

### list() Method

    public String[] list()

This method lists the names of the files contained by this IFile. An IFile can be constructed by using this IFile as the parent and calling FileSvc.get().getIFile(parent, name)

### listIFiles() Method

    public IFile[] listIFiles()

returns the list of IFiles contained by this IFile. These IFiles are constructed using the URIs returned by listURIs()

### listIFiles(IFileFilter) Method

    public IFile[] listIFiles(IFileFilter filter)

returns the list of IFiles contained by this IFile. This version allows the list to be filtered prior to being returned

#### Parameters

filter
  filter to apply to the IFile list

### listURIs() Method

    public URI[] listURIs()

returns the list of URIs contained by this IFile. If this IFile is not a container, it returns null