本文介绍了如何获得与Android的盒子内容-SDK缩略图(notV2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方式来获得新的Andr​​oid箱内容-SDK缩略图?
我看不出在doc和方法的任何东西:

There is a way to get the thumbnails with new box android-content-sdk?I don't see anything in the doc and methods:https://github.com/box/box-android-sdk

感谢。

推荐答案

有两种方法返回一个请求:

There are two methods that return a request:

/**
     * Gets a request that downloads a thumbnail to a target file
     *
     * @param target    target file to download thumbnail to
     * @param fileId    id of file to download the thumbnail of
     * @return  request to download a thumbnail to a target file
     * @throws IOException
     */
    public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(File target, String fileId) throws IOException{
        if (!target.exists()){
            throw new FileNotFoundException();
        }
        BoxRequestsFile.DownloadThumbnail request = new BoxRequestsFile.DownloadThumbnail(target, getThumbnailFileDownloadUrl(fileId),mSession);
        return request;
    }

    /**
     * Gets a request that downloads the given file thumbnail to the provided outputStream. Developer is responsible for closing the outputStream provided.
     *
     * @param outputStream outputStream to write file contents to.
     * @param fileId the file id to download.
     * @return  request to download a file thumbnail
     */
    public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(OutputStream outputStream, String fileId) {
        BoxRequestsFile.DownloadThumbnail request = new BoxRequestsFile.DownloadThumbnail(outputStream, getThumbnailFileDownloadUrl(fileId),mSession);
        return request;
    }

这篇关于如何获得与Android的盒子内容-SDK缩略图(notV2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 22:46