Article View: borland.public.jbuilder.java.language
Article #15421problem with getResourceAsStream
From: George Kontoravdis
Date: Thu, 17 Jun 1999 00:00
Date: Thu, 17 Jun 1999 00:00
48 lines
1906 bytes
1906 bytes
This is a multi-part message in MIME format.
--------------E8D8CA8B7C8ECE281201D9DE
Content-Type: text/plain; charset=iso-8859-7
Content-Transfer-Encoding: 7bit
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
--------------E8D8CA8B7C8ECE281201D9DE
Content-Type: text/x-vcard; charset=iso-8859-7;
name="georgek.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for George Kontoravdis
Content-Disposition: attachment;
filename="georgek.vcf"
begin:vcard
n:Kontoravdis;George
tel;pager:5126998887@messaging.sprintpcs.com
tel;fax:413-825-7930
tel;work:512-346-8887
x-mozilla-html:FALSE
org:Veltisto
adr:;;P.O. Box 8507;Austin;TX;78713;USA
version:2.1
email;internet:georgek@veltisto.com
title:Technology & Operations Research Consultant
x-mozilla-cpt:;12608
fn:George Kontoravdis, Ph.D.
end:vcard
--------------E8D8CA8B7C8ECE281201D9DE--
Technical Details
Message-ID:
<376940EB.DD1620DF@veltisto.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,dc587644af89e9e3,start X-Google-Attributes: gidf74b3,public From: George Kontoravdis <georgek@veltisto.com> Subject: problem with getResourceAsStream Date: 1999/06/17 Message-ID: <376940EB.DD1620DF@veltisto.com> X-Deja-AN: 490765360 X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------E8D8CA8B7C8ECE281201D9DE" Organization: Veltisto Mime-Version: 1.0 Reply-To: georgek@veltisto.com Newsgroups: borland.public.jbuilder.java.language