|
|
|
|
how to use file:// protocol to access directory
Posted:
Sep 28, 2008 7:34 AM
|
|
|
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?
|
|
|
|
|
|
|
Re: how to use file:// protocol to access directory
Posted:
Sep 29, 2008 4:32 AM
in response to: george_ustc
|
|
|
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
|
|
|
|
|