Package com.logicaldoc.core.conversion
Class AbstractFormatConverter
java.lang.Object
com.logicaldoc.core.conversion.AbstractFormatConverter
- All Implemented Interfaces:
- FormatConverter
- Direct Known Subclasses:
- CompressedArchiveConverter,- GhostscriptConverter,- ImageConverter,- MarkdownConverter,- P7MConverter,- PstConverter,- XMLConverter
Abstract format converter.
- Since:
- 7.7
- Author:
- Marco Meschieri - LogicalDOC
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidTemplate method that invokesconvert(String, Document, File, File)final voidIf the converter is enabled it invokes theinternalConvert(String, Document, File, File)booleanstatic StringgetExtension(String fileNameOrExtension) Gets the extension for the given filename, if an alias is found then the value of the alias is returned as well.getParameter(String name) Gets the value of a parameterImplementations should return the list of the required parameters.Returns the map of parametersinthashCode()booleanChecks if the converter is enabled or notvoidReads it's own parameters and stores them in the parameters mapvoidsetEnabled(boolean enabled) Enables or disables the converter
- 
Method Details- 
convertTemplate method that invokesconvert(String, Document, File, File)- Specified by:
- convertin interface- FormatConverter
- 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
 
- 
convertIf the converter is enabled it invokes theinternalConvert(String, Document, File, File)- Specified by:
- convertin interface- FormatConverter
- 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
 
- 
loadParameterspublic void loadParameters()Description copied from interface:FormatConverterReads it's own parameters and stores them in the parameters map- Specified by:
- loadParametersin interface- FormatConverter
 
- 
isEnabledpublic boolean isEnabled()Description copied from interface:FormatConverterChecks if the converter is enabled or not- Specified by:
- isEnabledin interface- FormatConverter
- Returns:
- if the converter is enabled
 
- 
setEnabledpublic void setEnabled(boolean enabled) Description copied from interface:FormatConverterEnables or disables the converter- Specified by:
- setEnabledin interface- FormatConverter
- Parameters:
- enabled- the enabled flag
 
- 
getParametersDescription copied from interface:FormatConverterReturns the map of parameters- Specified by:
- getParametersin interface- FormatConverter
- Returns:
- map param_name = param_value
 
- 
getParameterDescription copied from interface:FormatConverterGets the value of a parameter- Specified by:
- getParameterin interface- FormatConverter
- Parameters:
- name- name of the configuration parameter
- Returns:
- the value of the configuration parameter
 
- 
getParameterNamesDescription copied from interface:FormatConverterImplementations should return the list of the required parameters. A parameter is stored in the context as converter.SimpleClassName.parameter = value- Specified by:
- getParameterNamesin interface- FormatConverter
- Returns:
- list of the configuration parameters
 
- 
hashCodepublic int hashCode()
- 
equals
- 
getExtensionGets the extension for the given filename, if an alias is found then the value of the alias is returned as well. For instance if in the settings you haveconverter.alias.eft=txtthen a file named test.eft will be considered a txt.- Parameters:
- fileNameOrExtension- file name or just the extension
- Returns:
- the real extension to use
 
 
-