Examples of DropboxSearchResult


Examples of org.apache.camel.component.dropbox.dto.DropboxSearchResult

     * @param query a space-separated list of substrings to search for. A file matches only if it contains all the substrings
     * @return a DropboxResult object containing all the files found.
     * @throws DropboxException
     */
    public DropboxResult search(String remotePath, String query) throws DropboxException {
        DropboxResult result = new DropboxSearchResult();
        DbxEntry.WithChildren listing = null;
        if (query == null) {
            LOG.info("search no query");
            try {
                listing = DropboxAPIFacade.client.getMetadataWithChildren(remotePath);
            } catch (DbxException e) {
                throw new DropboxException(remotePath + " does not exist or can't obtain metadata");
            }
            result.setResultEntries(listing.children);
        } else {
            LOG.info("search by query:" + query);
            List<DbxEntry> entries = null;
            try {
                entries = DropboxAPIFacade.client.searchFileAndFolderNames(remotePath, query);
            } catch (DbxException e) {
                throw new DropboxException(remotePath + " does not exist or can't obtain metadata");
            }
            result.setResultEntries(entries);
        }
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.