Using the File System API
(Page 1 of 4 )
Adobe's Apollo is a cross platform desktop runtime. Use it with Flex, and you can build Flash-based Rich Internet Applications (RIA). This article, the first of two parts, shows you how to use Apollo's file system API. It is excerpted from chapter four of the book
Apollo for Adobe Flex Developer's Pocket Guide, written by Mike Chambers, Rob Dixon and Jeff Swartz (O'Reilly, 2007; ISBN: 0596513917). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
Apollo provides a file I/O API that lets applications read and write files and directories on the user’s computer. The file I/O API includes the following functionality:
Create and delete files and directories
Copy and move files and directories
List the contents of directories
Get system information on files and directories
Read and write binary files
Read and write text files
Serialize and deserialize ActionScript objects
The low-level functionality for working with the file system is accessed via ActionScript. The Flex framework for Apollo includes components for working with files and directories, but these are graphical components for navigating the file system and selecting files and directories. They do not provide direct access to the more fundamental file I/O operations.
In addition to the information in this chapter, see the examples presented in “Working with the File System” in Chapter 5. Those examples illustrate many of the concepts described in this chapter, and they provide working MXML code that you can test, using Flex Builder or the Apollo SDK.
Security Model Apollo will eventually provide a complete security model for managing access to local resources, such as the file system. However, this security model has not been implemented in the Apollo Alpha 1 build.
It is important to remember that Apollo applications are installed to and run from the user’s computer. Apollo applications have a different security context and security model than those of web browsers. Because of this, the same rules that apply to downloading and running other applications also apply to downloading and running Apollo applications. Users should download and install applications only from trusted sources.
Next: Accessing Files and Directories >>
More Flash Articles
More By O'Reilly Media
|
This article is excerpted from chapter four of the book Apollo for Adobe Flex Developer's Pocket Guide, written by Mike Chambers, Rob Dixon and Jeff Swartz (O'Reilly, 2007; ISBN: 0596513917). Check it out today at your favorite bookstore. Buy this book now.
|
|