🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: reading a file into an applet from my web site

#19605
From: Rich Wilkman
Date: Tue, 13 Jan 1998 00:00
144 lines
5024 bytes
Greg:

You have to lose the buffered reader and do it "the old fashioned way". 
Looking at the structure, however, I can't see any direct reason for
BufferedReader to be in violation of the security manager.  O'Reilly
says it's just an analog of InputStream optimized for character streams
instead of bytestreams.  That leads me to conjecture that the VM
implementation in the browser has applied yet another arbitrary
"security" rule.

Have you tried it IE or Hot Java?  If it works in HotJava then you are
most likely hitting a Browser specific limitation.  If it doesn't work
in HotJava then there may be a real reason for the security limitation
but not one of the ones you can find out via "traditional" mechanisms.

-Rich

Greg Dickson wrote:
> 
> Thanks Rich
> Ive tried
>  URL myConfigFile = new URL( getDocumentBase(), "adminCfg.txt");
>  textArea1.append(myConfigFile + "\n");
>  InputStream inStream = myConfigFile.openStream();
>  BufferedReader thePage = new BufferedReader(
>         new InputStreamReader(
>         inStream));
> 
> and it still fails what am I missing
> do I have to lose the BufferedReader
> Greg
> 
> Rich Wilkman wrote in message <34BBA53A.32991AF3@corp.borland.com>...
> |Greg:
> |
> |You need to work with InputStreams instead of File based classes that
> |implement the security manager (and hence get killed in Applets).
> |You're already on the right track, but after you create your URL try
> |something like:
> |
> |InputStream iStr = myConfigFile.openStream();
> |
> |and then work with the read mechanisms off of InputStream.
> |
> |-Rich
> |
> |
> |Greg Dickson wrote:
> |>
> |> Hi guys
> |>
> |> I have been tring to read a file in the same directory on my web
> site
> |> (its a config file for the applet that I would prefer not to be a
> set
> |> of parameters)
> |> is this possible
> |> I have tried several things and I got this to work on IE4 but only
> on
> |> it
> |> try {
> |>  URL myConfigFile = new URL( getDocumentBase(), "config.txt");
> |>  URLConnection connectFile = myConfigFile.openConnection();
> |>  BufferedReader thePage = new BufferedReader(
> |>         new InputStreamReader(
> |>         connectFile.getInputStream()));
> |>
> |> this throws an
> |> AppletSecurityException:
> |> in all other browsers
> |>
> |> Hey I only want to read a file from wense I came is this possible
> yet
> |> or must the applet be signed ... etc to do just this
> |>
> |> Or via CGI
> |>
> |> thanks heaps Greg Dickson
> |> witchy@netserv.net.au


Greg Dickson wrote:
> 
> Thanks Rich
> Ive tried
>  URL myConfigFile = new URL( getDocumentBase(), "adminCfg.txt");
>  textArea1.append(myConfigFile + "\n");
>  InputStream inStream = myConfigFile.openStream();
>  BufferedReader thePage = new BufferedReader(
>         new InputStreamReader(
>         inStream));
> 
> and it still fails what am I missing
> do I have to lose the BufferedReader
> Greg
> 
> Rich Wilkman wrote in message <34BBA53A.32991AF3@corp.borland.com>...
> |Greg:
> |
> |You need to work with InputStreams instead of File based classes that
> |implement the security manager (and hence get killed in Applets).
> |You're already on the right track, but after you create your URL try
> |something like:
> |
> |InputStream iStr = myConfigFile.openStream();
> |
> |and then work with the read mechanisms off of InputStream.
> |
> |-Rich
> |
> |
> |Greg Dickson wrote:
> |>
> |> Hi guys
> |>
> |> I have been tring to read a file in the same directory on my web
> site
> |> (its a config file for the applet that I would prefer not to be a
> set
> |> of parameters)
> |> is this possible
> |> I have tried several things and I got this to work on IE4 but only
> on
> |> it
> |> try {
> |>  URL myConfigFile = new URL( getDocumentBase(), "config.txt");
> |>  URLConnection connectFile = myConfigFile.openConnection();
> |>  BufferedReader thePage = new BufferedReader(
> |>         new InputStreamReader(
> |>         connectFile.getInputStream()));
> |>
> |> this throws an
> |> AppletSecurityException:
> |> in all other browsers
> |>
> |> Hey I only want to read a file from wense I came is this possible
> yet
> |> or must the applet be signed ... etc to do just this
> |>
> |> Or via CGI
> |>
> |> thanks heaps Greg Dickson
> |> witchy@netserv.net.au
Technical Details
Message-ID: <34BBFE34.51CB041E@corp.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <69fs5n$b5b9@forums.borland.com> <34BBA53A.32991AF3@corp.borland.com> <69gpsp$bnh14@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,95f8cdf01d946206
X-Google-Attributes: gidf74b3,public
From: Rich Wilkman <rwilkman@corp.borland.com>
Subject: Re: reading a file into an applet from my web site
Date: 1998/01/13
Message-ID: <34BBFE34.51CB041E@corp.borland.com>
X-Deja-AN: 315693905
Content-Transfer-Encoding: 7bit
References: <69fs5n$b5b9@forums.borland.com> <34BBA53A.32991AF3@corp.borland.com> <69gpsp$bnh14@forums.borland.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Organization: None
Newsgroups: borland.public.jbuilder.java.language