If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
radpin
Posts: 21
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

(FileConnection)Connector.open("file:///" + path)

So I'm doing something like this:

 

case FileSystemJournalEntry.FILE_ADDED:

String path = entry.getPath();

 

Then I do a: (FileConnection)Connector.open("file:///" + path)

 

What's weird is that the path that the code sees is this: file:////SDCard/BlackBerry/pictures/whatever.jpg

(it throws a net.rim.device.api.io.file.fileIOException: File system error)

 

If I bring up the image, and look its properties, it says: /Media Card/BlackBerry/pictures/whatever.jpg

 

I'm guessing the problem is:

a) I have too many forward slashes in my file address

b) There is some black magic regards to why /Media Card/ and /SDCard/ seem to be at odds with eachother?

 

 

Thanks so much!

Please use plain text.
Developer
radpin
Posts: 21
Registered: ‎07-15-2008
My Device: Not Specified

Re: (FileConnection)Connector.open("file:///" + path)

[ Edited ]

So now I my code is trying to access file://SDCard/BlackBerry/pictures/whatever.jpg (still no love; I catch an exception after this).

 

So... /SDCard/ == /Media Card/ ?   -_-

Message Edited by radpin on 01-14-2009 06:59 PM
Please use plain text.
Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: (FileConnection)Connector.open("file:///" + path)

There should be exactly 3 slashes...  2 for the protocol: "file://" and 1 that indicates the top level file system: "/SDCard".  "Media Card" is just an pretty alias that you see when using the built-in apps.

 

"file:///SDCard/something..." should be correct.

 

 

Please use plain text.
Developer
radpin
Posts: 21
Registered: ‎07-15-2008
My Device: Not Specified

Re: (FileConnection)Connector.open("file:///" + path)

Thank you kind sir!
Please use plain text.