且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

funf删除上传后的归档文件

更新时间:2023-12-04 20:01:16

DefaultArchive (我假设你正在使用)解释的这里如下:

The behaviour of the DefaultArchive (which I assume you are using) is explained here as follows:

备份文件夹偶尔清理删除旧文件。
  备份文件保存,只要它们不是免费的侵权
  盘的空间。默认存档将保持至少10MB的
  备份,以及最大等于***空间的50%可在
  驾驶。例如,如果有可用的空闲空间200MB
  SD卡,然后存档将备份存储多达100MB。

The backup folder is occasionally cleaned up to delete older files. Backup files are kept as long as they are not infringing on the free space of the disk. The default archive will keep a minimum of 10MB of backup, and a maximum equal to 50% of the free space available on the drive. For instance if there is 200MB of free space available on the SD Card, then the archive will store a backup of up to 100MB.

当然,你可以随时根据自己的需要通过实现你自己的存档修改此。

Of course, you can always modify this according to your needs by implementing your own archive.

另外,你可以如安排使用 AlarmManager 重复任务时,在其中你可以清理备份 - 定期使用标准的Java文件操作的文件夹(有一个 #getPathOnSDCard() -method在DefaultArchive对象)。另一种可能性是例如一次后手动执行此操作轻敲删除备份按钮上。

Alternatively, you could e.g. schedule a repeating task using the AlarmManager, in which you could clean up the backup-folder periodically using standard Java file-operations (there's a #getPathOnSDCard()-method in the DefaultArchive-object). Another possibility is to do this once manually after e.g. tapping a "delete backup"-button.