This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting root folder name in J2ME Midlet application  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am having problem to get the root folder name of a mobile (working with device (Nokia-5800)). The value I am getting is "null".

The same code when run on the emulator (Nokia-6350), I am getting correct root folder (/root1/) which is under "/DefaultColorPhone/filesystem/".

Please let me know, how can i get the root folder name for any mobile device in a J2ME Midlet application.

The code i tried and i got the value as null is shown below:

Enumeration roots = FileSystemRegistry.listRoots();
String rootFolderName = (String)roots.nextElement();
Alert splashScreen = null;

if (rootFolderName != null){
splashScreen = new Alert(null, "Root folder is not null: "+rootFolderName, null, AlertType.INFO);

splashScreen = new Alert(null, "Root folder not found", null, AlertType.INFO);

The output i am getting for this is Alert Screen Mentioning "Root Folder not found".

Is there some other way where we can get the root folder name? Please assist....

Thanks and Regards,
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!