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
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800
My Carrier: Rogers

FileConnection.exists() always returning true in 5.0.0

I just started trying the 5.0.0 beta API and I am finding that FileConnection.exists() always returns true in the simulator. Under 4.6.0, if the file did not already exist, FileConnection.exists() would return false. However, under 5.0.0 the FileConnection.open() method seems to automatically create a file if one doesn't already exist. So after the .open() call, the check of .exists() always returns true.

 

How can I check if a file exists under 5.0.0?

 

thanks,

 

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: FileConnection.exists() always returning true in 5.0.0

I didn't find this problem.

 

I checked for file fc = (FileConnection)Connector.open("file:///SDCard/xyz/sample.3gp"); which doesn't exists and it returns false. Tested on JDE 5.0.


Use Search. "Accept Solution" If the problem is resolved.
Highlighted
Developer
Posts: 49
Registered: ‎05-20-2009
My Device: Not Specified

Re: FileConnection.exists() always returning true in 5.0.0

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: FileConnection.exists() always returning true in 5.0.0

Try in BB Eclipse plugin, Am working in BB Eclipse plugin I never got such type of exception with the file connection.

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 49
Registered: ‎05-20-2009
My Device: Not Specified

Re: FileConnection.exists() always returning true in 5.0.0

im using BBeclipse plugin

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: FileConnection.exists() always returning true in 5.0.0

@squished18: Is there even a FileConnection.open() method? Perhaps you code post some code?




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.