Package org.h2gis.functions.io.file_table

# Class FileEngine<Driver extends org.h2gis.api.FileDriver>

java.lang.Object
org.h2gis.functions.io.file_table.FileEngine<Driver>

Type Parameters:
  `Driver` - file driver

All Implemented Interfaces:
  `org.h2.api.TableEngine`

Direct Known Subclasses:
  `DBFEngine`, `SHPEngine`

public abstract class FileEngine<Driver extends org.h2gis.api.FileDriver> extends Object implements org.h2.api.TableEngine
Implement theses abstract methods in order to define a file engine.

Author:
  Nicolas Fortin

## Constructor Summary

Constructors
Constructor
Description
`FileEngine()`

## Method Summary

Modifier and Type
Method
Description
`protected abstract Driver`
`createDriver(File filePath, List<String> args)`
Create the driver instance using the file name and additional arguments provided in SQL create table request.
`org.h2.table.TableBase`
`createTable(org.h2.command.ddl.CreateTableData data)`
`protected abstract void`
`feedCreateTableData(Driver driver, org.h2.command.ddl.CreateTableData data)`
Add columns definition of the file into the CreateTableData instance.
`static String`
`getUniqueColumnName(String base, List<org.h2.table.Column> columns)`
Compute unique column name among the other columns

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

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

## Constructor Details

### FileEngine

public FileEngine()

## Method Details

### createTable

public org.h2.table.TableBase createTable(org.h2.command.ddl.CreateTableData data)

Specified by:
  `createTable` in interface `org.h2.api.TableEngine`

### getUniqueColumnName

public static String getUniqueColumnName(String base, List<org.h2.table.Column> columns)
Compute unique column name among the other columns

Parameters:
  `base` - Returned name if there is no duplicate
  `columns` - Other existing columns
Returns:
  Unique column name

### createDriver

protected abstract Driver createDriver(File filePath, List<String> args) throws IOException
Create the driver instance using the file name and additional arguments provided in SQL create table request.

Parameters:
  `filePath` - First argument, file name
  `args` - Additional argument, contains the file name as first argument
Returns:
  Instance of FileDriver
Throws:
  `IOException`

### feedCreateTableData

protected abstract void feedCreateTableData(Driver driver, org.h2.command.ddl.CreateTableData data) throws IOException
Add columns definition of the file into the CreateTableData instance.

Parameters:
  `driver` - driver object
  `data` - Data to initialise
Throws:
  `IOException`