如何使用 android 核心 API 检测特定的给定保管箱路径是文件还是不文件?
How can I detect the particular given dropbox path is file or not using android core API?
我想使用 android core API
检测特定 dropbox
路径是否为文件。这怎么可能?感谢任何帮助。
我找到了片段
The isDir field on DropboxAPI.Entry tells you if the Entry is a file
or folder.
// 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";
}
Also posting Directory create and delete methods available in DropboxAPI
mApi.createFolder(directory_path);
mApi.delete(directory_or_file_path);
谢谢。
我想使用 android core API
检测特定 dropbox
路径是否为文件。这怎么可能?感谢任何帮助。
我找到了片段
The isDir field on DropboxAPI.Entry tells you if the Entry is a file or folder.
// 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";
}
Also posting Directory create and delete methods available in DropboxAPI
mApi.createFolder(directory_path);
mApi.delete(directory_or_file_path);
谢谢。