AIR 中的 File 对象 所访问的文件夹位置
AIR 中的 File 对象 所访问的文件夹位置




关于File.cacheDirectory的一点说明
According to the Apple guidelines, data that can be downloaded again or regenerated shall be stored in the <APPLICATION_HOME>/Library/Caches directory.
So, with AIR 3.6, a new static property, File.cacheDirectory has been introduced, which points to this directory. Files stored in this directory are not backed up on the iCloud.
Examples of files you should put in the Caches directory include database cache files and downloadable content, such as that used by magazine, newspaper, and map applications.
On Mac OSX and Android, File.cacheDirectory points to the Caches directory ( <APPLICATION_HOME>/Library/Caches on Mac and <APPLICATION_HOME>/caches directory on Android). While on Windows, it points to the parent directory being used by File.createTempDirectory.
var myCacheFile: File = File.cacheDirectory.resolvePath("cacheFile.txt");
There can be cases when a file or directory is required to be stored in a directory other than <APPLICATION_HOME>/Library/Caches directory, but still not required to be backed up on the iCloud, eg. files stored in the application storage directory. To address this issue, another property, preventBackup has been added to the File API. The default value of this property is false on all platforms and can be set to true only on iOS. When the property is set to true for a File object on iOS, the file/directory corresponding to that File object is not backed up on the iCloud. If the File object points to a directory on iOS, all files in that directory are not backed up (irrespective of the values of preventBackup for individual files/sub-directories of that directory). This property works on iOS 5.1 devices and later and does not work on the iOS Simulator. Files stored in APP_HOME/tmp/ or APP_HOME/Library/Caches directory are not backed up, irrespective of the value set for this property. On querying the value of preventBackup for a particular File object, the last set value of preventBackup or false (the default value) will be returned on iOS and all other platforms will continue to return false, even if explicitly set to true.
var file: File = File.applicationStorageDirectory.resolvePath("abc.txt");
file.preventBackup = true;
The above properties will only work for application descriptor namespace 3.6 (or greater) and SWF version greater than 19.
AIR 中的 File 对象 所访问的文件夹位置的更多相关文章
- 在linux和Mac中访问某个文件夹中所有的文件
在linux和Mac中访问某个文件夹中所有的文件——输出所有的文件名 #include <stdio.h> #include <dirent.h> int main() { s ...
- Path,Files巩固,题目:从键盘接收两个文件夹路径,把其中一个文件夹中(包含内容)拷贝到另一个文件夹中
这个题目用传统的File,InputStream可以做,但是如果用Files,Path类做,虽然思路上会困难一些,但是代码简洁了很多,以下是代码: import java.io.IOException ...
- windwo访问linux文件夹方法
windwo访问linux文件夹:是通过linux的samba来实现的: 安装samba需要安装samba-client.samba-common.smaba3个包. 一:安装rpm 现有一个服务器l ...
- node静态资源服务器的搭建----访问本地文件夹(搭建可访问静态文件的服务器)
我们的目标是实现一个可访问静态文件的服务器,即可以在浏览器访问文件夹和文件,通过点击来查看文件. 1.先创建一个文件夹anydoor,然后在该文件夹里npm init一个package.json文件, ...
- AD域-让共享目录只显示用户有权限访问的文件夹
问题: 在AD域中,我们一般都会用到共享,如果有很多部门,我们可能还会按部门.职位配置权限.比如CSD,IT,PA等,但文件夹一多,用户看着就头大,而且用户没权限访问的文件夹误点击进去还会提示无权限访 ...
- FTP文件夹打开错误,Windows无法访问此文件夹
错误提示: Windows 无法访问此文件夹,请确保输入的文件夹是正确的,并且你有权访问此文件夹. 解决方法/步骤如下 1.请确保输入的文件夹是正确的,并且你有权访问此文件夹.可以在浏览器 ...
- [置顶] 如何访问web文件夹之外的文件
在编写项目时,遇到一个如何访问web文件夹之外的文件的问题.因为我要制作一个浏览图片和pdf文件的一个简单网站.但问题是图片的文件夹和pdf文件的文件夹都是其他程序生成的,自然也就是不是网站w ...
- 使用javascript来访问本地文件夹
常用的.net 的aspx文件由于运行在服务器端,并不具有访问用户本地文件夹的权限,导致类似于<a href="file:///d:/backup" > open fo ...
- vue-cli中自定义路径别名 assets和static文件夹的区别
转自:vue-cli中自定义路径别名 assets和static文件夹的区别 静态资源处理: assets和static文件夹的区别 相信有很多人知道vue-cli有两个放置静态资源的地方,分别是sr ...
随机推荐
- 3D 生物打印血管成功植入恒河猴体内
3D 生物打印血管成功植入恒河猴体内
- ubuntu 工作区中拖动一个窗体到另一个工作区就卡住回不到桌面了
ubuntu 工作区中拖动一个窗体到另一个工作区就卡住回不到桌面了 解决方法: 按 alt + 回车 键直接就返回去了
- ArcGIS Server 缓存服务增加新比例尺缓存
win10 + Server 10.4 + ArcMap 10.4 操作简单说明: ①窗口上方Customize栏→Toolbars→ Customize→ 搜索到 manege map serv ...
- 【转】Xamarin.Android 入门之:Xamarin+vs2015 环境搭建
Xamarin.Android 入门之:Xamarin+vs2015 环境搭建 一.前言 此篇博客主要写了如何使用搭建xamarin开发的环境,防止我自己万一哪天电脑重装系统了,可以直接看这篇博客 ...
- dom paser
dom paser /** * */ package ec.utils; import java.io.BufferedInputStream; import java.io.ByteArrayInp ...
- jquery autocomplete插件结合ajax使用
<%@ page isELIgnored="false"%> <%@ page contentType="text/html; charset=UTF- ...
- selenium webdriver
http://www.blogjava.net/qileilove/archive/2014/02/18/409975.html Selenium VS Webdriver Selen ...
- 在windows下创建一个Mongo服务
首先需要下载mongo的安装包 cmd.exe 这个需要用管理员权限打开 进入到mongo的安装目录 首先到C盘根据下面的命令手动创建一个 Data 文件夹 在Data 里面创建一个db文件夹一个lo ...
- js判断ie版本号
jQuery 2.0 去除了对浏览器版本号的判断(它推荐特性检测),这里是一个老外写的原生判断方法,这段代码着实巧妙!既简介.有向后兼容!一般做法都是:正则搜索 USER_AGENT :但因为历史原 ...
- delphi android 录像(调用Java的功能)
delphi xe系列自带的控件都无法保存录像,经网友帮忙,昨天终于实现了录像功能(但有个问题是录像时无画面显示),程序主要使用了JMediaRecorder,MediaRecorder的使用方法可参 ...