The Source for Java Technology Collaboration

Home » java.net Forums » Phone ME » phoneME Feature software

Thread: how to use file:// protocol to access directory

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Last Post: Sep 29, 2008 4:32 AM by: romanz Threads: [ Previous | Next ]
george_ustc

Posts: 25
how to use file:// protocol to access directory
Posted: Sep 28, 2008 7:34 AM
  Click to reply to this thread Reply

I checked MR3 JAMS support file:// protocol to install a midlet. but it seems they don't provide function to allow user access a directory. Does somebody know if the protocol file:// support browser a directory?

romanz

Posts: 8
Re: how to use file:// protocol to access directory
Posted: Sep 29, 2008 4:32 AM   in response to: george_ustc
  Click to reply to this thread Reply

To access anything in the device file system via file:// protocol, JSR-75 FileConnection is used. The JSR is able to restrict file system access, i.e. not show the entire directory structure to Java applications. Typically, the first thing a MIDlet should do before attempting to access any directory (after verifying that JSR-75 is present), is a call to javax.microedition.io.file.FileSystemRegistry.listRoots(), which tells what virtual file system roots are accessible to the application. For an example of FileConnection usage, you can check the FileBrowser MIDlet in PDAPDemo suite from Sun Java Wireless Toolkit (version 2.5.2 is available at http://java.sun.com/products/sjwtoolkit/download.html).

For more details on the FileConnection API, please see the specification at http://www.jcp.org/en/jsr/detail?id=75

Regards,
Roman




 XML java.net RSS