有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java在Android中使用box时,如何获得最近上传文件的共享链接?

在Android中使用box时,如何获得最近上传文件的共享链接

mFileApi.getCreateSharedLinkRequest(fileId).setCanDownload(true)
            .setAccess(BoxSharedLink.Access.OPEN)
            .toTask().addOnCompletedListener(new BoxFutureTask.OnCompletedListener<BoxFile>() {
        @Override
        public void onCompleted(BoxResponse<BoxFile> response) {
            if (response.isSuccess()) {
                BoxFile boxFile = response.getResult();
                String downloadUrl = boxFile.getSharedLink().getDownloadURL();
                Log.e("downloadurl", "onCompleted: " + downloadUrl);
                //This return me a web link to show the Box page to download the file
            } else {
                Toast.makeText(MainActivity.this, "error while getting sharelink", Toast.LENGTH_SHORT).show();
            }
        }
    }).run();

共 (1) 个答案