[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find xml file on classpath
Thanks for the tips, that did it, and no slash needed.
ClassLoader loader = this.getClass().getClassLoader();
URL xmlUrl = loader.getSystemResource("my.xml");
~michael
On Friday, September 14, 2001, at 09:59 AM, Lukas Bradley wrote:
You *may* have to put a "/" in front of your XML file name. I might easily be wrong about this..... but.... if the code below doesn't work try
String myXML = "/myFileName.xml" ;
No sure... untested... just a hunch...
Lukas
-----Original Message-----
From: The411info@aol.com [mailto:The411info@aol.com]
Sent: Friday, September 14, 2001 12:26 AM
To: pommele@mindspring.com; ajug-members@www.ajug.org
Subject: Re: find xml file on classpath
Try:
InputStream input = ClassLoader.getSystemResourceAsStream(myXml);