org.eclipse.ease.modules.platform

## Class FilesystemHandle

- java.lang.Object
- - org.eclipse.ease.modules.platform.FilesystemHandle

All Implemented Interfaces:
  IFileHandle

Direct Known Subclasses:
  ResourceHandle

    public class FilesystemHandle
    extends Object
    implements IFileHandle

### Field Summary

### Fields inherited from interface org.eclipse.ease.modules.platform.IFileHandle

`APPEND, READ, WRITE`

### Constructor Summary

Constructors
Constructor and Description
`FilesystemHandle(File file, int mode)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Close a file instance.
`boolean` `createFile(boolean createHierarchy)` Create a file.
`boolean` `exists()` Check if a physical file exists.
`Object` `getFile()` Get the base file object.
`String` `read(int characters)` Read characters from a file.
`String` `readLine()` Read a line of data from a file.
`void` `setMode(int mode)`
`boolean` `write(String data)` Write data to a file

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FilesystemHandle

    public FilesystemHandle(File file,
                            int mode)

### Method Detail

#### read

    public String read(int characters)
                throws IOException

Description copied from interface: `IFileHandle`
Read characters from a file.

Specified by:
  `read` in interface `IFileHandle`
Parameters:
  `characters` - amount of characters to read
Returns:
  data read from file
Throws:
  `IOException` - on access errors

#### readLine

    public String readLine()
                    throws IOException

Description copied from interface: `IFileHandle`
Read a line of data from a file. Reads until a line feed is detected.

Specified by:
  `readLine` in interface `IFileHandle`
Returns:
  single line of text
Throws:
  `IOException` - on access errors

#### write

    public boolean write(String data)

Description copied from interface: `IFileHandle`
Write data to a file

Specified by:
  `write` in interface `IFileHandle`
Parameters:
  `data` - data to write
Returns:
  `true` on success

#### exists

    public boolean exists()

Description copied from interface: `IFileHandle`
Check if a physical file exists.

Specified by:
  `exists` in interface `IFileHandle`
Returns:
  `true` when file exists

#### createFile

    public boolean createFile(boolean createHierarchy)
                       throws Exception

Description copied from interface: `IFileHandle`
Create a file.

Specified by:
  `createFile` in interface `IFileHandle`
Parameters:
  `createHierarchy` - create parent folders if they do not exist
Returns:
  `true` on success
Throws:
  `Exception` - on creation errors

#### setMode

    public void setMode(int mode)

#### close

    public void close()

Description copied from interface: `IFileHandle`
Close a file instance.

Specified by:
  `close` in interface `IFileHandle`

#### getFile

    public Object getFile()

Description copied from interface: `IFileHandle`
Get the base file object. Returns an `IFile` or a `File` instance.

Specified by:
  `getFile` in interface `IFileHandle`
Returns:
  base file object