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

New Developer
New Developer
Posts: 13
Registered: ‎10-24-2009
My Device: Not Specified
Accepted Solution

FileConnection.getPath() returns invalid path


eclipse: 3.41

JDE package 4.6.0

Windows Vista 64bit


If through a fileConnection (say earlier obtained for "sdcard/home")  you try to get the parent folder by calling getPath(), it returns a path with a "/" at the beginning. Now if you pass this path to:

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

an exception will be thrown.


I my test runs it has the same problem regardless of the root I select (SDCard, system, store).


New Developer
Posts: 2
Registered: ‎12-23-2009
My Device: Curve 8310
My Carrier: Rogers

Re: FileConnection.getPath() returns invalid path

getPath() returns the path with file:// (two slashes) removed from the beginning.  Change the "file:///" literal in your open call to only have two slashes and it should work.