🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Can Web Applets Read Server-Based Text Files?

#8148
From: S Garland
Date: Sun, 22 Apr 2001 02:17
25 lines
2188 bytes
Does anyone know how to get an Applet on a Web server to read a text file
which resides on the same server in the same directory as the Applet and
calling HTML page?  I have tried something like the simplified method below,
but get a security exception.  I think it thinks I'm trying to read the file
from the client machine.

----------------------------------------------------------------------------
 public void loadInhabitants()
 {
      String strFilename ="D:\\tomcat\\Inhabitants\\Report.txt";
      try
      {
           BufferedReader brIn = new BufferedReader(new
FileReader(strFilename));
           String strLine;
           while ((strLine = brIn.readLine()) != null)
                System.out.println(strLine);
           brIn.close();
      }
      catch (IOException e)
      {
           System.err.println(e.getMessage());
      }
 }
----------------------------------------------------------------------------
Technical Details
Message-ID: <865A9243C943913B.924975F5696C016F.79AFBB3A63825537@lp.airnews.net>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!128.230.129.106!news.maxwell.syr.edu!nntp.flash.net!cabal11.airnews.net!news.airnews.net!cabal1.airnews.net!news-f.iadfw.net!usenet

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,f488bdd39e791e20,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-04-21 19:20:07 PST
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!128.230.129.106!news.maxwell.syr.edu!nntp.flash.net!cabal11.airnews.net!news.airnews.net!cabal1.airnews.net!news-f.iadfw.net!usenet
From: "S Garland" <s_garland@hotmail.com>
Newsgroups: borland.public.jbuilder.java.language
Subject: Can Web Applets Read Server-Based Text Files?
Date: Sat, 21 Apr 2001 21:17:29 -0500
Organization: PDQ.net (using Airnews.net!)
Lines: 27
Message-ID: <865A9243C943913B.924975F5696C016F.79AFBB3A63825537@lp.airnews.net>
X-Orig-Message-ID: <9btenk$54v@library2.airnews.net>
Reply-To: "S Garland" <s_garland@hotmail.com>
Abuse-Reports-To: abuse at pdq.net to report improper postings
NNTP-Proxy-Relay: library2.airnews.net
NNTP-Posting-Time: Sat Apr 21 21:13:08 2001
NNTP-Posting-Host: !Yh7P1k-VWbV5Ve (Encoded at Airnews!)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200