Reputation: 10529
I want to detect a particular dropbox
path is file or not using android core API
.how come this possible ? Any help is appreciated.
Upvotes: 0
Views: 143
Reputation: 10529
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);
Thank you.
Upvotes: 1