Hi,
I’m trying to read .properties file using JRuby, calling the java
classes. The problem is if there are comma separated values in the
property file, it fetches only the first value.
For example, say I have
a line like “type=abc,cde” in the property file. The output of “puts
prop.get_property(“type”)” returns only the first value (abc) and the
not 2nd value.
Below is my code:
require ‘java’
include_class ‘java.util.Properties’
include_class ‘java.io.FileInputStream’
def read_prop_file
prop = Properties.new
fileInput = FileInputStream.new("E:\\test\\test.properties")
prop.load(fileInput)
fileInput.close
puts prop.get_property("type")
puts prop.get_property("module_names")
end
Am I doing anything wrong here? how can we retrive all the values
related to a property?
Thanks