本文整理汇总了Java中com.dropbox.core.DbxClient.move方法的典型用法代码示例。如果您正苦于以下问题:Java DbxClient.move方法的具体用法?Java DbxClient.move怎么用?Java DbxClient.move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.dropbox.core.DbxClient
的用法示例。
在下文中一共展示了DbxClient.move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dropboxImport
import com.dropbox.core.DbxClient; //导入方法依赖的package包/类
public void dropboxImport() throws DCMAException {
DropboxHelper helper = new DropboxHelper(getProperties());
helper.setPluginName("dcma-dropboximport-plugin");
DbxClient client = helper.authenticateApp();
String[] bcs = getBatchClassConfig().split(";");
for (String batchClassIdentifier : bcs) {
LOGGER.debug("Importing the batch class " + batchClassIdentifier);
try {
String dropboxFolder = getProperty(batchClassIdentifier, "folder");
String filePattern = getProperty(batchClassIdentifier, "pattern");
String action = getProperty(batchClassIdentifier, "action");
String actionName = action.split("\\|")[0];
LOGGER.debug(" - Dropbox folder: " + dropboxFolder);
LOGGER.debug(" - File pattern: " + filePattern);
DbxEntry.WithChildren listing = client.getMetadataWithChildren(dropboxFolder);
LOGGER.debug(" - Files in the folder:");
if (listing != null) {
for (DbxEntry child : listing.children) {
System.out.println(" -- " + child.name);
if (child.name.matches(filePattern)) {
System.out.println(" -- Import file");
importFilesFromDropbox(child, batchClassIdentifier, client);
if (actionName.equalsIgnoreCase("moveTo")) {
String targetFolder = action.split("\\|")[1];
client.move(child.path, targetFolder + "/" + child.name);
} else if (actionName.equalsIgnoreCase("delete"))
client.delete(child.path);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例2: call
import com.dropbox.core.DbxClient; //导入方法依赖的package包/类
@Override
protected final void call(final DbxClient client, final ProgressMonitor pm) throws DbxException {
pm.begin(1);
client.move(from_path, to_path);
}