Skip to main content

read file xmi in application java

2 replies [Last post]
Joined: 2004-10-28

Hello All,
I´m Isa, and enough time will be here.
My question is:

that I should make to read from an application java a file
I would like to see example.

If nobody knows as reading file.xmi, at least would like me
to see example of like one reads a text file, for example.

Thank you all.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-10-11

Wrong forum, Isa. You should not ask these kind of questions here.
However, you can read text file like this:
StringBuffer sb = new StringBuffer();
BufferedReader br = new BufferedReader(new FileReader(new File("file.xmi")));
String line;
while ( (line = br.readLine()) != null) {
String wholeFile = sb.toString();
Should work but I did not test it, sorry.

XMI is XML file and you'll probably want to use XML parser for this. I suggest you look after DOM4J or JDOM

Joined: 2004-10-28

thank you that a good day you happen.