【函数】 | JsonArray list(String path) |
【说明】 | 读取assets中path指定的文件夹中所有的文件。 |
【返回】 | JSON数组,使用eval('('+json+')')转换为JavaScript数组。 |
【参数】 | path:文件夹路径,根路径为空。 |
【示例】 |
alert(rexseeAsset.list(''));
运行示例
|
【函数】 | boolean exists(String path) |
【说明】 | 判断assets中是否存在指定的文件。 |
【返回】 | true或false。 |
【参数】 | path:文件路径。 |
【示例】 |
alert(rexseeAsset.exists('beep.ogg'));
运行示例
|
【函数】 | int getSize(String path) |
【说明】 | 读取assets中path指定的文件的长度。 |
【返回】 | 文件长度。 |
【参数】 | path:文件路径。 |
【示例】 |
alert(rexseeAsset.getSize('beep.ogg'));
运行示例
|
【函数】 | String getContent(String path, String encode) |
【说明】 | 读取assets中path指定的文件的内容。 |
【返回】 | 文件内容。 |
【参数】 | path:文件路径。 encode:编码。 |
【示例】 |
alert(rexseeAsset.getContent('beep.ogg','UTF-8'));
运行示例
|
【函数】 | boolean copyToExternalStorage(String assetPath, String sdPath) |
【说明】 | 读取assetsPath指定的文件复制到SD卡中。 |
【返回】 | true或false。 |
【参数】 | assetPath:源文件路径。 sdPath:目标文件路径。 |
【示例】 |
alert(rexseeAsset.copyToExternalStorage('beep.ogg','file:///sdcard/assetBeep.ogg'));
运行示例
|