[MOBY-dev] Service registration from XML

wasser hao.chen at uni-bielefeld.de
Wed May 7 11:10:39 UTC 2008


hallo,

thank you for your advice. Yes, I should use methode stringBuffer()
instead  "+" operator. I wrote this code just for test and want to know
if I can register service from xml with methode registerService(). 

and if it works , xml string  should be constructed directly without
reading XML from a file. 

cheers 
hao chen

On Wed, 2008-05-07 at 11:26 +0200, Dmitry Repchevsky wrote:
> 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
> 
> 
> 
> 
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-dev




More information about the MOBY-dev mailing list