繁体   English   中英

如何使用Android Core API检测特定的给定保管箱路径是否为文件?

[英]How can I detect the particular given dropbox path is file or not using android core API?

我想检测特定的dropbox路径是文件还是不使用android core API这怎么可能? 任何帮助表示赞赏。

我发现了片段

ISDIR现场DropboxAPI.Entry告诉你,如果该条目是一个文件或文件夹。

        // Get the metadata for a directory
        Entry dirent = mApi.metadata(mPath, 1000, null, true, null);

        if (!dirent.isDir || dirent.contents == null) {
            // It's not a directory, or there's nothing in it
            mErrorMsg = "File or empty directory";
        }

还发布DropboxAPI中可用的目录创建和删除方法

mApi.createFolder(directory_path);
mApi.delete(directory_or_file_path);

谢谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM