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

Returns a new instance of FileConfigurationUpdater.



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

def initialize()
    super()
end

Instance Method Details

#init(obj) ⇒ Object



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

def init(obj)
end

#updateConfiguration(ref_configuration) ⇒ Object



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

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