public class OtherFormatsDescriptor extends PluginDescriptor
Constructor and Description |
---|
OtherFormatsDescriptor(java.lang.String fileExtension,
java.lang.String mimeType,
boolean hideSubstitutes,
java.lang.String name,
java.lang.String copyRightString,
java.lang.String version,
java.util.Properties props)
This Class is use by a PicApport plugin to describe the supported file-types.
|
Modifier and Type | Method and Description |
---|---|
void |
createSubstitute(java.io.File substitute,
java.io.File file)
PicApport internal method
author Eric 09.02.2015
|
void |
dump()
PicApport internal method to display info of this plugin on console(logfile)
|
java.lang.String |
getCopyRightString() |
java.lang.String |
getDownloadText(java.util.Locale locale)
author Eric 11.09.2020
|
java.lang.String |
getFileExtension() |
IOtherFileFormat |
getFileFormatPlugin()
PicApport internal method
author Eric 09.02.2015
|
de.contecon.picapport.plugins.otherformats.IOtherImageFormat |
getImageFormatPlugin()
PicApport internal method
author Eric 09.02.2015
|
java.lang.String |
getLocalisedText(java.lang.String id,
java.lang.String defaultText)
PicApport internal method
author Eric 09.02.2015
|
java.lang.String |
getLocalisedText(java.lang.String isoLanguage,
java.lang.String id,
java.lang.String defaultText)
PicApport internal method
author Eric 09.02.2015
|
java.lang.String |
getMimeType() |
java.lang.String |
getName() |
java.util.Properties |
getProps() |
java.io.File |
getSubstituteFile(java.io.File file)
PicApport internal method
author Eric 09.02.2015
|
java.lang.String |
getVersion() |
boolean |
hideSubstitutes() |
boolean |
isOtherFileFormatPlugin()
PicApport internal method
author Eric 09.02.2015
|
boolean |
isOtherImageFormatPlugin()
PicApport internal method
author Eric 09.02.2015
|
getPluginImpl, setPluginImpl
public OtherFormatsDescriptor(java.lang.String fileExtension, java.lang.String mimeType, boolean hideSubstitutes, java.lang.String name, java.lang.String copyRightString, java.lang.String version, java.util.Properties props)
public List<OtherFormatsDescriptor> init(File pluginDirectory, Properties props, IPicApportPlugInLogger logger) {
this.logger = logger;
if(props != null) {
setResolutionFromString(props.getProperty("pdf.resolution"));
}
return Arrays.asList(
new OtherFormatsDescriptor[] {
new OtherFormatsDescriptor(".pdf",
"application/pdf",
true,
"PicApport PDF plugin",
"(c) 2015 Contecon Software GmbH",
"1.0",
props),
});
}
fileExtension
- File extension e.g. "gif" or "png"mimeType
- Mime-type of original file "image/gif" or "image/png"hideSubstitutes
- if true the created substitute files will have the hidden attribute set (we recommend to set this to true)name
- The name of the plugin. It will be visible in the logfiles. E.g. "PicApport PNG plugin"copyRightString
- The copyright String for the plugin. It will be visible in the logfiles. E.g. "(c) 2014 Contecon Software GmbH"version
- The plugin version. It will be visible in the logfiles. E.g. "1.0"props
- The Properties passed to the init() method of the pluginpublic java.lang.String getFileExtension()
public java.lang.String getMimeType()
public boolean hideSubstitutes()
public java.lang.String getName()
public java.lang.String getCopyRightString()
public java.lang.String getVersion()
public java.util.Properties getProps()
public java.lang.String getDownloadText(java.util.Locale locale)
locale
- locale that should be usedpublic void dump()
public boolean isOtherFileFormatPlugin()
public IOtherFileFormat getFileFormatPlugin()
public boolean isOtherImageFormatPlugin()
public de.contecon.picapport.plugins.otherformats.IOtherImageFormat getImageFormatPlugin()
public java.io.File getSubstituteFile(java.io.File file)
file
- the original filepublic void createSubstitute(java.io.File substitute, java.io.File file) throws java.lang.Exception
substitute
- substitute filefile
- original filejava.lang.Exception
- if an error occurspublic java.lang.String getLocalisedText(java.lang.String isoLanguage, java.lang.String id, java.lang.String defaultText)
isoLanguage
- isoLanguage (es, de, fr etc...)id
- id of textdefaultText
- should be Englishpublic java.lang.String getLocalisedText(java.lang.String id, java.lang.String defaultText)
id
- id of textdefaultText
- should be English