Dropbox的API:我怎样才能获得剩余的可用空间量? [英] Dropbox API: how can I get the amount of remaining free space?

查看:148
本文介绍了Dropbox的API:我怎样才能获得剩余的可用空间量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来,该Dropbox的API无法告诉的链接的Dropbox帐户剩余的可用空间的能力。我只能得到用户的配额总量,通过使用.accountInfo()调用。

It seems to me that the Dropbox API lacks the ability to tell the remaining available free space for the linked Dropbox account. I can only get the total quota of the user, by using the .accountInfo() call.

我看到的唯一办法是遍历所有文件的用户存储在Dropbox的,并总结了它们的大小,然后从配额总量减去这一数额。该解决方案似乎很可怕的,缓慢的,有没有更好的办法呢?

The only way I see is to iterate over all the files the user stores in Dropbox, and sum up their sizes, then subtract this amount from the total quota. This solutions seems quite terrible and slow, is there a better way to this?

一点题外话,我试图这样做在Android上,但我不认为这是一个洗车台相关的问题。

As a sidenote, I attempt to do this on Android, but I don't think that this is a platfrom-dependent question.

推荐答案

为/帐户的文档/信息呼叫状态:

quota_info /普通用户的使用共享文件夹(字节)。

quota_info/normal The user's used quota outside of shared folders (bytes).

quota_info /共享用户的使用配额中的共享文件夹(字节)。

quota_info/shared The user's used quota in shared folders (bytes).

quota_info /配额的用户的总配额分配(字节)。

quota_info/quota The user's total quota allocation (bytes).

所以,自由空间应该仅仅是:

So, the free space should just be:

quota - normal - shared

这篇关于Dropbox的API:我怎样才能获得剩余的可用空间量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆