I have been using older dropboxapiv2 (java) to search "Files" for 2 years. Today it started to malfunction due to a dropbox server side "malformed query" error. While I assume it is again a Dropbox development malfunction, I also would like to upgrade the dropboxapiv2 I am using to version 3.1.3 . It seems there is now a search method searchV2(String query) ,but I could not find any documentation about how to write a search query for dropbox search in api.
Can anybody help ?
with errors below is my code for, now deprecated, search method
public List<SearchMatch> findFile(String code) {
try {
SearchResult sr = dbxClient.files().search("/drawings/",code);
List<SearchMatch> sm = sr.getMatches();
List<SearchMatch> rmlist = new ArrayList<SearchMatch>();
for (SearchMatch searchMatch : sm) {
if (!fileMidir(searchMatch.getMetadata())) {
rmlist.add(searchMatch);
}
}
for (SearchMatch searchMatch : rmlist) {
sm.remove(searchMatch);
}
return sm;
} catch (DbxException e) {
e.printStackTrace();
}
return null;
}
public boolean fileMidir(Metadata metadata){
if (metadata instanceof FolderMetadata) {
return false;
}else {
return true;
}
}