当前位置: 首页>>代码示例>>Java>>正文


Java DbxEntry.isFolder方法代码示例

本文整理汇总了Java中com.dropbox.core.DbxEntry.isFolder方法的典型用法代码示例。如果您正苦于以下问题:Java DbxEntry.isFolder方法的具体用法?Java DbxEntry.isFolder怎么用?Java DbxEntry.isFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.dropbox.core.DbxEntry的用法示例。


在下文中一共展示了DbxEntry.isFolder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isFolder

import com.dropbox.core.DbxEntry; //导入方法依赖的package包/类
@Override
public boolean isFolder(String child) throws IOException {
    boolean isfolder = false;

    try {
        DbxEntry entry = this.dbClient.getMetadata(child);

        if (entry.isFolder()) {
            isfolder = true;
        }
    } catch (DbxException ex) {
        throw new IOException("Error in folder checking");
    }

    return isfolder;
}
 
开发者ID:modcs,项目名称:caboclo,代码行数:17,代码来源:DropboxClient.java

示例2: collectDropboxEntries

import com.dropbox.core.DbxEntry; //导入方法依赖的package包/类
private void collectDropboxEntries(DbxClient client, Map<String, Long> dropboxEntries, String path) throws DbxException {
	WithChildren entries = client.getMetadataWithChildren(path);
	for (DbxEntry entry : entries.children) {
		if (entry.isFolder()) {
			collectDropboxEntries(client, dropboxEntries, entry.path);
		} else {
			dropboxEntries.put(entry.path, entry.asFile().lastModified.getTime());
		}
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:11,代码来源:DropboxSynchronizer.java

示例3: getChildren

import com.dropbox.core.DbxEntry; //导入方法依赖的package包/类
@Override
public List<RemoteFile> getChildren(String folderName) throws IOException {
    try {
        ArrayList<RemoteFile> result = new ArrayList<>();

        DbxEntry.WithChildren listing = dbClient.getMetadataWithChildren(folderName);

        if (listing == null) {
            throw new IOException("Folder: " + folderName + " does not exist");
        }

        for (DbxEntry child : listing.children) {
            String path = child.path;
            boolean directory = child.isFolder();

            long size = 0;

            if (!directory) {
                size = child.asFile().numBytes;
            }

            String base = "https://api-content.dropbox.com/1/files/dropbox";

            String url = escapeURL(base, path);

            RemoteFile file = new RemoteFile(path, directory, size, url);

            result.add(file);
        }
        return result;
    } catch (DbxException ex) {
        throw new IOException("Dropbox folder listing error.");
    }
}
 
开发者ID:modcs,项目名称:caboclo,代码行数:35,代码来源:DropboxClient.java

示例4: downloadFolder

import com.dropbox.core.DbxEntry; //导入方法依赖的package包/类
public void downloadFolder(String remotePath, String targetPath, int depth)
		throws CSPException {
	try {
		DbxEntry folder = client.getMetadata(remotePath);
		if (folder.isFolder()) {
			File remoteFolder = new File(remotePath);
			File targetFolder = new File(targetPath + File.separator
					+ remoteFolder.getName());
			if (!targetFolder.exists()) {
				targetFolder.mkdirs();
			}
			DbxEntry.WithChildren folderWithChildren = client
					.getMetadataWithChildren(remotePath);
			for (DbxEntry file : folderWithChildren.children) {
				if (depth >= DropboxConstants.MAX_TREE_SEARCH_DEPTH) {
					break;
				}
				if (file.isFile()) {
					downloadFile(file.path, targetPath + "/" + folder.name
							+ "/" + file.name);
				} else if (file.isFolder()) {
					downloadFolder(file.path, targetPath + "/"
							+ folder.name, depth + 1);
				}
			}
		}
	} catch (DbxException e) {
		e.printStackTrace();
	}
}
 
开发者ID:Rohde-Schwarz-Cybersecurity,项目名称:PanBox,代码行数:31,代码来源:DropboxAPIIntegration.java

示例5: _addToCache

import com.dropbox.core.DbxEntry; //导入方法依赖的package包/类
private void _addToCache(final DbxEntry entry)
{
	if (entry.isFolder())
	{
		cacheFiles.put(entry.path, entry);
	}
}
 
开发者ID:HolgerHees,项目名称:cloudsync,代码行数:8,代码来源:RemoteDropboxConnector.java

示例6: collectDropboxEntries

import com.dropbox.core.DbxEntry; //导入方法依赖的package包/类
private void collectDropboxEntries(DbxClient client, Map<String, Long> dropboxEntries, String path)
        throws DbxException {
    WithChildren entries = client.getMetadataWithChildren(path);
    for (DbxEntry entry : entries.children) {
        if (entry.isFolder()) {
            collectDropboxEntries(client, dropboxEntries, entry.path);
        } else {
            dropboxEntries.put(entry.path, entry.asFile().lastModified.getTime());
        }
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:12,代码来源:DropboxSynchronizer.java


注:本文中的com.dropbox.core.DbxEntry.isFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。