Skip to main content

read file xmi in application java

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

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

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

thank you that a good day you happen.