New J2ME developers are often surprised to discover that the Connected Limited Device Configuration (CLDC) and the profiles based on it are not required to support the reading or writing of files. The Generic Connection Framework (GCF) defined by the CLDC does provide the basic scaffolding for file I/O, primarily through the The File Connection Optional Package (FCOP) is one of two optional packages defined by JSR 75 through the Java Community Process. The other, the PIM Optional Package, is discussed in another tech tip. Because the FCOP specification is still a draft standard and no reference implementation is yet available, the information presented here is still subject to change. If you're not familiar with optional packages, see the article "J2ME Optional Packages" for details on how they work. Simply put, an optional package is a set of programming interfaces that can be added to a J2ME profile or configuration to provide a category of functionality that some users of that configuration or profile will need but not all. FCOP can be supported on any J2ME platform, because it depends only on the core classes defined by the CLDC, and thus included in the Connected Device Configuration (CDC) as well. You can write applications that use FCOP in two ways. If all you want to do is read files, you can use the "
This code can be used on any platform that exposes the file system through the GCF, whether it supports FCOP or not. The Connected Device Configuration (CDC) and the profiles based on it all support this method of reading files, for example. Such a platform may also allow writing to files if you specify the The second way to use FCOP is through the new
The value of the property is the version number of FCOP, which for the first release is "1.0". When FCOP is supported, all GCF connections made using the " This is the format defined in Section 3.10 of RFC 1738, the document that defines the general format of a URL. Devices are unlikely to support file access across a network, so in almost every case the URL will refer to the local host, and the host part of the URL is commonly omitted. What's left, then, is the path part, consisting of a root (identifying the root directory of a mounted file system) and a file or directory path. On a Windows platform, for example, a valid URL might be: file:///c:/Program Files/Windows NT/Pinball/table.bmpOn a device with memory expansion slots the URL might look like this: file:///SDCard/users.txtBecause the number and names of mounted file systems vary from device to device, a support class is provided that lets applications list the available file systems. This The file URL passed to
The URL can also refer to files or directories that don't yet exist. You can create a file using
Note that almost every method in the We've only touched on a few aspects of FCOP. For full details, check out the Javadoc for the FCOP classes. Back To Top |
출처 : http://developers.sun.com/techtopics/mobility/apis/ttips/fileconnection/
'java UI' 카테고리의 다른 글
| jsp 2.0 사용시 예제 (0) | 2009.01.01 |
|---|---|
| quartz 를 이용하기 (0) | 2008.01.22 |
| File Connection Optiobal Package (0) | 2006.02.28 |
| [펌] DataSource의 복제를 통한 다중 플레이어 생성방법 (0) | 2005.12.02 |
| jtable tutorial (0) | 2005.02.16 |
| The Eclipse runtime options (0) | 2005.02.15 |



댓글을 달아 주세요