本文整理了Java中ch.cyberduck.core.Local.lock()
方法的一些代码示例,展示了Local.lock()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Local.lock()
方法的具体详情如下:
包路径:ch.cyberduck.core.Local
类名称:Local
方法名:lock
暂无
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param source Connection to source server of transfer. May be null.
* @param destination Connection to target server of transfer
* @param files Files pending transfer
* @param callback Prompt
*/
public void pre(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback) throws BackgroundException {
for(TransferItem item : roots) {
switch(this.getType()) {
case download:
final Local directory = item.local.getParent();
locks.put(directory, directory.lock(true));
break;
case upload:
locks.put(item.local, item.local.lock(true));
break;
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException {
final Path home = new LocalHomeFinderFeature(this).find();
try {
lock = LocalFactory.get(this.toPath(home).toString()).lock(true);
}
catch(LocalAccessDeniedException e) {
log.debug(String.format("Ignore failure obtaining lock for %s", home));
}
}
内容来源于网络,如有侵权,请联系作者删除!