java - 有没有办法在 Android 中的文件上设置自定义(又名用户定义)文件属性?
问题描述
我需要设置用户定义的属性有两个原因,1-标记加密文件,2-实现像 MacOS 的 Finder 那样的标签系统。
这是我尝试过的:
Files.setAttribute(
Paths.get("/storage/emulated/0/Download/21014040_9_Fizik_KTT.pdf"),
"user:tagred",
"testtesttest"
));
给出这个错误:
java.lang.UnsupportedOperationException:查看“用户”不可用
Path path = new File(filePath).toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);
在这里,视图为空。
我应该改用什么?
解决方案
推荐阅读
- python - 合并两个 DataFrame 表,使用 Pandas 聚合数据
- html - 将 div 居中放在 div 中。里面的 div 必须小于父 div。引导程序 4
- apache-camel - Apache Camel 请求-回复模式故障超过 3 个或更多微服务
- javascript - 解析具有包含 html 标记的属性的编码 php 对象
- postgresql - 多列索引不用于仅索引扫描,但部分索引是
- ios - 从视图控制器的分离文件中呈现视图控制器
- asp.net-mvc-5.2 - ASP MVC 5 - 用户可以独立更改多个部分视图的顺序
- python - 将数组相乘的最佳方法是什么?在 Python 中
- php - 从数据透视表中获取 id 以在 laravel 的表单构建器中使用
- python - 如何使 sin(pi) 和 cos(pi/2) 为零?