Article View: borland.public.jbuilder.java.language
Article #15422Re: problem with getResourceAsStream
From: Bill Israel
Date: Thu, 17 Jun 1999 00:00
Date: Thu, 17 Jun 1999 00:00
25 lines
1412 bytes
1412 bytes
I am using the exact feature, the first time I tried I got the results you
expressed. In my case it was nothing more than the file not being in the
classpath that JBuilder was using.
George Kontoravdis <georgek@veltisto.com> wrote in message
news:376940EB.DD1620DF@veltisto.com...
>
> I'm using JB3 (jdk 1.2) and I'm having trouble getting
> "getResourceAsStream" to work. For some reason the following code
> always sets input stream "in" to null:
>
> String resource_name = new String("myclass.properties");
> InputStream in = myclass.class.getResourceAsStream(resource_name);
>
> However, if I explicitly open the file using:
>
> InputStream in = new FileInputStream(resource_name);
>
> "in" is set to the correct input file stream.
>
> Any suggestions how to get "getResourceAsStream" to work?
>
> Thanks,
>
> George
Technical Details
Message-ID:
<7kbhtp$pmt10@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<376940EB.DD1620DF@veltisto.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,dc587644af89e9e3 X-Google-Attributes: gidf74b3,public From: "Bill Israel" <remove_bisrael@harland.net> Subject: Re: problem with getResourceAsStream Date: 1999/06/17 Message-ID: <7kbhtp$pmt10@forums.borland.com> X-Deja-AN: 490782091 References: <376940EB.DD1620DF@veltisto.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.language