Skip to main content

read file xmi in application java

2 replies [Last post]
isabel
Offline
Joined: 2004-10-28
Points: 0

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
xmi?.
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.
patrikbeno
Offline
Joined: 2004-10-11
Points: 0

Wrong forum, Isa. You should not ask these kind of questions here.
However, you can read text file like this:
[code]
StringBuffer sb = new StringBuffer();
BufferedReader br = new BufferedReader(new FileReader(new File("file.xmi")));
String line;
while ( (line = br.readLine()) != null) {
sb.append(line);
}
String wholeFile = sb.toString();
[/code]
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

isabel
Offline
Joined: 2004-10-28
Points: 0

thank you that a good day you happen.