Box.net的应用程序文件夹



对于dropbox,我们使用一个"应用程序文件夹"来放置应用程序的文档。经过身份验证后,我们只能看到该文件夹的文件。Box.net的等价物是什么?

查看(Java)API,似乎唯一的选择是查看驱动器上的所有文件。

查看ProvisionGrant工作流。给定一个电子邮件地址,Box将向用户的帐户添加一个沙盒应用程序文件夹,根据需要创建帐户。

John的回答是正确的,Provision Grant是实现这一目标的方法。至于Java SDK,不幸的是,它还不支持配置身份验证工作流(这是我们希望添加的功能)。

但是,如果您能够手动进行配置身份验证,则可以将访问/刷新令牌交给SDK,然后正常使用。

BoxAPIConnection api = new BoxAPIConnection("clientID", "clientSecret",
    "accessToken", "refreshToken");
// You can also set the expiration time if you want the SDK to auto-
// refresh your access token for you.
api.setExpires(expires); 
// Your application's folder will be returned after you authenticate
// with provision grant.
String appFolderID = "id";
BoxFolder appFolder = new BoxFolder(api, appFolderID);
for (BoxItem.Info itemInfo : appFolder) {
    // Do something with the items in your app's folder.
}

抱歉这不是很直观。我创建了一个为SDK添加更好的提供授权支持的问题。

相关内容

最新更新