cancel
Showing results for 
Search instead for 
Did you mean: 

please explain the user defined fuction

Former Member
0 Kudos

please explain this userdefined fuction

String value = "";

try {

Properties _propSet = new Properties();

_propSet.load(new FileInputStream("/xxxxxx/xxx.properties"));

value = _propSet.getProperty(companyCode);

}catch(Exception e) {value = e.toString(); }

return value;

}

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Sridhar,

it creates a Properties object variable _propSet.......

then it loads the data of /xxxxxx/xxx.properties file by opening /xxxxxx/xxx.properties file by FileInputStream class in _propSet variable..

then it assigns value variable the data of CompanyCode which it has loaded from the above file from the _propSet object's getProperty function.....

if some error happens in either opening the above file or getting companycode data, then an exception is thrown which is caught in catch block and then the error msg is set in value variable.

Then value variable is returned.

Hope this clears this UDF to you.

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Sridhar,

wht this UDF does is to read "property file" which is preseted in ("/xxxxxx/xxx.) this location .

this file as value for companyCode which are assiging it to value field and passing it to output.

Former Member
0 Kudos

Hi Sridhar,

The UDF is simply reading a a Property file from File system and retrieves a value for a property called "CompanyCode" and maps to a target field.

Ideally your Property will have Name & Value pairs like this..

XXX.Properties

-


CompanyCode=AB12

BillTo=BC22

...etc

Regards,

Ananth

former_member192343
Active Contributor
0 Kudos

it seems it get some information from file /xxxxxx/xxx.properties

and get companyCode from this information and set it to the value