Using the File System API - URI Schemes (Page 3 of 4 )
A URI scheme is specified at the beginning of a URL, such as file in the following example:
file:///c:/ApolloTest/test.txt
In addition to thefileURI scheme, Apollo supports the new URI schemesapp-storageand
app-resource.
app-storage Identifies the application storage directory, as shown in the following example:
var logFile:File = File.appStorageDirectory;
logFile = logFile.resolve("log.txt");
trace(logFile.url); // app-storage:/log.txt
app-resource Identifies this application’s installation folder, as in the following:
var installDir:File = new File();
installDir.url = "app-resource:/";
installDir = installDir.resolve("HelloWorld-app.xml");
trace(installDir.url); // app-resource:/HelloWorld-app.xml
file The url property of otherFileobject returns a standardfileURL scheme:
var file:File = File.documentsDirectory;
file = file.resolve("ApolloTest/test.txt");
trace(file.url);
// On Windows:
// file:///C:/Documents%20and %20Settings/ ... /test.txt
// On Mac OS:
// file:///Users/userName/Documents/ ... /test.txt
blog comments powered by