on 11-07-2007 2:05 PM
Hello Friends,
I am trying to fetch a file during the message mapping. The code I have written in the UDF is as follows :
<u>
String company = "";
HashMap fileMap = new HashMap();
BufferedReader reader = new BufferedReader(new FileReader("C:
testfolder
Mydata.txt"));
String line = "";
while((line = reader.readLine())!=null)
{
String[] lineArray = line.split(",");
fileMap.put(lineArray[1], lineArray[0]);
}
company = (String) fileMap.get(a);
return company; </u>
<b>
But I am getting the FileNotFound Exception when I tried to run the interface mapping.
I have confirmed that file is there in the respective folder.
1. Can we use the above code to fetch the file ?
2. Do we need to put the file in the XI server ?
</b>
Thanks for your time.
~PRANAV
and what exactly you are trying to do with this code ?
to access files,you need to use Java io api's,and you can access file from any server,not just XI server
but there are few drawbacks with this,first of all the file name and path will be hardcoded so u need to change it every time you move your file from Dev to QA to Prd.
secondly this approach is good to read the file,but not a very good idea to write something in the file
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
a
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Havent tried it but seems possible
2. It should be on the XI server.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pranav,
where is the path located ? on XI Server?
Ranjeet Singh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.