Motorola E680 Technical Manual - Page 67
Sample for FileConnection Interface
![]() |
View all Motorola E680 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 67 highlights
16 File System Access API Sample for FileConnection Interface import javax.microedition.io.*; import com.motorola.io.*; /* * Get a root of file system */ java.lang.String root = FileSystemRegistry.listRoots()[0]; /* * Create a FileConnection object pointing to root directory */ FileConnection fc = null; try { fc = (FileConnection) Connector.open("file://"+root); } catch (IOException ioe) { }catch (Security Exception se) {} ... } /* * Get available, used and total size of file system */ long availableSize = fc.availablesize(); long usedSize = fc.usedSize(); long totalSize = fc.totalSize(); /* * Determine the size in bytes that is used by a directory */ try { long rootSize = fc.directorySize(false); } catch (IOException ioe) { ... } /* * Get list of files in root */ java.lang.String list[] = fc.list(); /* * Check if first item in the list is directory */ try { fc = (FileConnection) Connector.open("file://" +list[0]); } catch (IOException ioe) { 67
![](/manual_guide/products/motorola-e680-technical-manual-dca3926/67.png)