🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19735

Re: Loading HTML from a JAR file

#19735
From: Scott Lavender
Date: Tue, 23 Dec 1997 00:00
49 lines
2353 bytes
Juan,

Thanks for the reply. I don't think that you understood my question. Or
maybe I didn't ask it clearly. My existing Java application already uses the
appropriate code to load images and other files from within a JAR file.

What I was asking is how can I allow a web browser to access the HTML files
when not running the application.

Thanks.....

-----Original Message-----
From: Juan Pedro Barbancho Manchon [SMTP:ct2bamaj@uco.es]
Sent: Tuesday, December 23, 1997 7:09 AM
To: Lavender, Scott
Subject: Re: Loading HTML from a JAR file

Scott Lavender wrote:

> Does anyone know how to access HTML files that are located in a JAR
> file?
>
> I have an application that is distributed as a JAR file. The
> applications' help files (HTML) are loacted within the JAR file in a
> "help/" subdirectory. When the user is running the application, the
> application provides code to view the help files. This works fine.
>
> I would like for the user to be able to access the help files
> off-line,
> application not running, with out extracting them from the JAR. Is
> there
> a way to use a standard browser to view these HTML documents from
> inside
> the JAR?
>
> Any help would be appreciated.
>
> Thanks.....

   Dear sir,
In order to read files from a .jar, I recommend you to use
        URL in = this.getClass().getResource( file );
the file dout be in .jar located in Classpath.

You only dout
    setDocument( in);

JuanP
Technical Details
Message-ID: <349FACC9.A194C759@s2systems.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <349ED181.20CDCC69@s2systems.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10a146,f0172b5e4d7dead7
X-Google-Attributes: gid10a146,public
X-Google-Thread: 14aafe,48a2dd43499a6e2b,start
X-Google-Attributes: gid14aafe,public
X-Google-Thread: f74b3,f0172b5e4d7dead7
X-Google-Attributes: gidf74b3,public
X-Google-Thread: 113ae9,f0172b5e4d7dead7
X-Google-Attributes: gid113ae9,public
From: Scott Lavender <Scott_Lavender@s2systems.com>
Subject: Re: Loading HTML from a JAR file
Date: 1997/12/23
Message-ID: <349FACC9.A194C759@s2systems.com>
X-Deja-AN: 309610947
Content-Transfer-Encoding: 7bit
References: <349ED181.20CDCC69@s2systems.com>
Content-Type: text/plain; charset=us-ascii
Organization: S2 Systems, Inc
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.help,borland.public.java.language