Package com.logicaldoc.core.conversion
Interface FormatConverter
-
- All Known Implementing Classes:
AbstractFormatConverter
,GhostscriptConverter
,ImageConverter
,NoConversionConverter
,NotAvailableConverter
,P7MConverter
,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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
convert(File src, File dest)
Performs the conversionvoid
convert(String sid, Document document, File src, File dest)
Performs the conversionString
getParameter(String name)
Gets the value of a parameterList<String>
getParameterNames()
Implementations should return the list of the required parameters.Map<String,String>
getParameters()
Returns the map of parametersboolean
isEnabled()
Checks if the converter is enabled or notvoid
loadParameters()
Reads it's own parameters and stores them in the parameters mapvoid
setEnabled(boolean enabled)
Enables or disables the converter
-
-
-
Method Detail
-
convert
void convert(File src, File dest) throws IOException
Performs the conversion- Parameters:
src
- The source filedest
- 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 filedest
- 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
-
-