org.eclipse.ease.modules.platform

## Class ResourceHandle

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

All Implemented Interfaces:
  IFileHandle

    public class ResourceHandle
    extends FilesystemHandle

### Field Summary

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

`APPEND, READ, WRITE`

### Constructor Summary

Constructors
Constructor and Description
`ResourceHandle(IFile file, int mode)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `createFile(boolean createHierarchy)` Create a file.
`static boolean` `createFolder(IContainer container)` Create a new container on the workbench.
`boolean` `exists()` Check if a physical file exists.
`java.lang.Object` `getFile()` Get the base file object.
`boolean` `write(byte[] data)` Write data to a file.
`boolean` `write(java.lang.String data)` Write data to a file.

### Methods inherited from class org.eclipse.ease.modules.platform.FilesystemHandle

`close, read, readLine, setMode`

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

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

### Constructor Detail

#### ResourceHandle

    public ResourceHandle(IFile file,
                          int mode)

### Method Detail

#### write

    public boolean write(java.lang.String data)

Description copied from interface: `IFileHandle`
Write data to a file. Uses platform default encoding to write strings to the file.

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

#### write

    public boolean write(byte[] data)

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

Specified by:
  `write` in interface `IFileHandle`
Overrides:
  `write` in class `FilesystemHandle`
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`
Overrides:
  `exists` in class `FilesystemHandle`
Returns:
  `true` when file exists

#### createFile

    public boolean createFile(boolean createHierarchy)
                       throws CoreException

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

Specified by:
  `createFile` in interface `IFileHandle`
Overrides:
  `createFile` in class `FilesystemHandle`
Parameters:
  `createHierarchy` - create parent folders if they do not exist
Returns:
  `true` on success
Throws:
  `CoreException`

#### createFolder

    public static boolean createFolder(IContainer container)
                                throws CoreException

Create a new container on the workbench.

Parameters:
  `container` - container to create
Returns:
  `true` on success
Throws:
  `CoreException` - thrown when folder cannot be created

#### getFile

    public java.lang.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`
Overrides:
  `getFile` in class `FilesystemHandle`
Returns:
  base file object