The Artima Developer Community
Sponsored Link

Java Answers Forum
Problem with file reading on a CD

2 replies on 1 page. Most recent reply: Apr 5, 2002 3:14 AM by Thomas SMETS

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Paresh Parihar

Posts: 1
Nickname: paresh
Registered: Mar, 2002

Problem with file reading on a CD Posted: Mar 28, 2002 3:28 AM
Reply to this message Reply
Advertisement
Hello,

I have created a utility where the applet reads from a file and displays an out put.
Though the utility runs ok on a file system on a hard disk, if i write the same
application on an CD the utility gives an error

---
com.ms.security.SecurityExceptionEx[app1.action]: cannot access file /E:/index.txt
at com/ms/security/permissions/FileIOPermission.check
at com/ms/security/PolicyEngine.deepCheck
at com/ms/security/PolicyEngine.checkPermission
at com/ms/security/StandardSecurityManager.chk
at com/ms/security/StandardSecurityManager.checkRead
at java/io/FileInputStream.<init>
at java/io/FileReader.<init>
at app1.action
at java/awt/Component.handleEvent
at java/awt/Component.postEvent
at java/awt/Component.postEvent
at java/awt/Component.dispatchEventImpl
at java/awt/Component.dispatchEvent
at java/awt/EventDispatchThread.run
---

These lines are used to access the file
String file = getCodeBase().getFile();
BufferedReader b1 = new BufferedReader(new FileReader(file+getParameter("FileNm")));

Anyone please help.

Paresh Parihar
Coddo Net Technologies P.Ltd
Office - +91-22-8785111 / 8717319
Personal email - nakool@hotmail.com


steve strongheart

Posts: 12
Nickname: stronghear
Registered: Apr, 2002

Re: Problem with file reading on a CD Posted: Apr 5, 2002 12:00 AM
Reply to this message Reply
Applets are generally not allowed to rummage freely through filesystems, and it's good that way.
However, if you digitally sign your applet, and grant it permission, It should be able to read data CD's.


A Java Application does not have that restriction.

Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Problem with file reading on a CD Posted: Apr 5, 2002 3:14 AM
Reply to this message Reply
Is the location of the file you read in the same directory when reading from a "normal" FS ?

Flat View: This topic has 2 replies on 1 page
Topic: Oracle driver problem Previous Topic   Next Topic Topic: Function sequence error??

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use