Class: WirisPlugin::FileConfigurationUpdater

Inherits:
Object
  • Object
show all
Extended by:
ConfigurationUpdaterInterface
Includes:
Wiris
Defined in:
lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb

Instance Method Summary collapse

Methods included from ConfigurationUpdaterInterface

ConfigurationUpdater

Constructor Details

#initializeFileConfigurationUpdater



11
12
13
# File 'lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb', line 11

def initialize()
  super()
end

Instance Method Details

#init(obj) ⇒ Object



14
15
# File 'lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb', line 14

def init(obj)
end

#updateConfiguration(ref_configuration) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb', line 16

def updateConfiguration(ref_configuration)
  configuration = ref_configuration
  confDir = PropertiesTools::getProperty(configuration,ConfigurationKeys::CONFIGURATION_PATH)
  if confDir!=nil
    confFile = confDir+"/configuration.ini"
    s = Storage::newStorage(confFile)
    if s::exists()
      defaultIniFile = IniFile::newIniFileFromFilename(confFile)
      h = defaultIniFile::getProperties()
      iter = h::keys()
      while iter::hasNext()
        key = iter::next()
        PropertiesTools::setProperty(configuration,key,h::get(key))
      end
    end
  end
end