Package com.logicaldoc.core.conversion

# Interface FormatConverter

All Known Implementing Classes:
  `AbstractFormatConverter`, `CompressedArchiveConverter`, `GhostscriptConverter`, `ImageConverter`, `MarkdownConverter`, `NoConversionConverter`, `NotAvailableConverter`, `P7MConverter`, `PstConverter`, `RarConverter`, `SevenZipConverter`, `TarConverter`, `XMLConverter`, `ZipConverter`

public interface FormatConverter
Implementations of this interface are specialized classes that perform conversion from a source format to a target format.

Since:
  7.1.3
Author:
  Marco Meschieri - LogicalDOC

## Method Summary

Modifier and Type
Method
Description
`void`
`convert(File src, File dest)`
Performs the conversion
`void`
`convert(String sid, Document document, File src, File dest)`
Performs the conversion
`String`
`getParameter(String name)`
Gets the value of a parameter
`List<String>`
`getParameterNames()`
Implementations should return the list of the required parameters.
`Map<String,String>`
`getParameters()`
Returns the map of parameters
`boolean`
`isEnabled()`
Checks if the converter is enabled or not
`void`
`loadParameters()`
Reads it's own parameters and stores them in the parameters map
`void`
`setEnabled(boolean enabled)`
Enables or disables the converter

## Method Details

### convert

void convert(File src, File dest) throws IOException
Performs the conversion

Parameters:
  `src` - The source file
  `dest` - The converted file, the extension of it's filename defines the output format
Throws:
  `IOException` - raised if the conversion resulted in an error

### convert

void convert(String sid, Document document, File src, File dest) throws IOException
Performs the conversion

Parameters:
  `sid` - The actual Session ID (optional)
  `document` - The document (optional)
  `src` - The source file
  `dest` - The converted file, the extension of it's filename defines the output format
Throws:
  `IOException` - raised if the conversion resulted in an error

### getParameterNames

List<String> getParameterNames()
Implementations should return the list of the required parameters. A parameter is stored in the context as converter.SimpleClassName.parameter = value

Returns:
  list of the configuration parameters

### getParameters

Map<String,String> getParameters()
Returns the map of parameters

Returns:
  map param_name = param_value

### getParameter

String getParameter(String name)
Gets the value of a parameter

Parameters:
  `name` - name of the configuration parameter
Returns:
  the value of the configuration parameter

### loadParameters

void loadParameters()
Reads it's own parameters and stores them in the parameters map

### isEnabled

boolean isEnabled()
Checks if the converter is enabled or not

Returns:
  if the converter is enabled

### setEnabled

void setEnabled(boolean enabled)
Enables or disables the converter

Parameters:
  `enabled` - the enabled flag