[MOBY-dev] Service registration from XML

Dmitry Repchevsky dmitry.repchevski at bsc.es
Wed May 7 09:26:12 UTC 2008


Hello!

I don't know about JMoby, but at first glance you don't add "/n" (for 
unix) into your regXML (must not matter, but...).
[advice] Never concatenate strings with "+" operator - use StringBuffer 
or StringBuilder (java5) instead...
[advice] Also it is always a good idea to close files :-)

|String linebreak = System.getProperty("line.separator"));|

StringBuilder buf = new StringBuilder();
BufferedReader in = new BufferedReader(new FileReader("//home//wasser//workspace//TestXMLReg.xml"));

try {
    String str;
    while((str=in.readLine())!=null) { 
    buf.append(str).append(linebreak);
    }
}
finally { in.close(); }

String regXML = buf.toString();

P.S. sorry for offtopic







More information about the MOBY-dev mailing list