(FileConnection) Connector.open("file:///c:/logo.png") - IOexception: Root not accessible
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   daniel_zanitchkhah
Posted On:   Tuesday, November 1, 2005 01:47 PM

Hello All, I have finally given up after spending an entire day reading through forums and suns website. I am now so desperate I am posting to ask for myself. Here's the problem... I am creating a midlet that will open a image from a directory on a phone (or emulator in my case) and add it to a display. When trying to do this I am recieving the following error: java.io.IOException: Root is not accessible. Can any body explain why this is? I am running NetBeans on XP, my emulator is running a MIDP2.0 and CLCD1.1 compatable. Here is some relevant code: FileConnection myFileConnection = (FileConnection) Co   More>>

Hello All,


I have finally given up after spending an entire day reading through forums and suns website. I am now so desperate I am posting to ask for myself.


Here's the problem...


I am creating a midlet that will open a image from a directory on a phone (or emulator in my case) and add it to a display.


When trying to do this I am recieving the following error:


java.io.IOException: Root is not accessible.


Can any body explain why this is? I am running NetBeans on XP, my emulator is running a MIDP2.0 and CLCD1.1 compatable.


Here is some relevant code:


FileConnection myFileConnection = (FileConnection) Connector.open("file:///c:/logo.png");


If i try myFileConnection.exsists() i get a false reply, however, if i try myFileConnection.create() i get the above exception... Please please please help.


Daniel

   <<Less

Re: (FileConnection) Connector.open("file:///c:/logo.png") - IOexception: Root not accessible

Posted By:   Anonymous  
Posted On:   Friday, January 13, 2006 04:09 AM

hi Daniel,




If you are accessing the file from your HDD, then the files should be placed in the "filesystem
oot1" folder of your emulator.



(Note: root1 is present by default in SonyEricsson folder)



for eg., Iam using SonyEricsson F500i Emulator..

so, my files will be stored in the following path..


C:SonyEricssonJ2ME_SDKPC_EmulationWTK2appdbSonyEricsson_F500ifilesystem
oot1


and then you may use the following code to access the file..


FileConnection fc = (FileConnection)Connector.open("file:///root1/");


Happy Coding.


Deepak Badiger


TLI Software, IDC


Bangalore India.

Re: (FileConnection) Connector.open("file:///c:/logo.png") - IOexception: Root not accessible

Posted By:   Anonymous  
Posted On:   Wednesday, November 9, 2005 08:58 AM

No, you don't need no backslash or less slashes. The problem is, that you try to open a file, that does not exist. FileConnection doesn't access the normal filesystem of your Pc.

I suppose you use WTK. If so, you have to create the following folder: 'C:WTK22appdbDefaultColorPhonefilesystem
oot1' (where 'C:WTK22' is the path to your WTK)

You can then store the logo.png in the root1 folder and access it by
(FileConnection) Connector.open("file:///root1/logo.png")

Now it is easy to understand, why you got the error, because you tried to access 'C:WTK22appdbDefaultColorPhonefilesystemc:/logo.png' which of course did not exist.

(Try also the 'FileSystemRegistry.listRoots()')

Greets Roger

Re: (FileConnection) Connector.open("file:///c:/logo.png") - IOexception: Root not accessible

Posted By:   Almagest_FUTT  
Posted On:   Wednesday, November 2, 2005 07:25 AM

Wouldn't you rather need a backslash after the drive's letter ?
About | Sitemap | Contact