ch.cyberduck.core.Local.isSymbolicLink()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中ch.cyberduck.core.Local.isSymbolicLink()方法的一些代码示例,展示了Local.isSymbolicLink()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Local.isSymbolicLink()方法的具体详情如下:
包路径:ch.cyberduck.core.Local
类名称:Local
方法名:isSymbolicLink

Local.isSymbolicLink介绍

[英]Checks whether a given file is a symbolic link.
[中]检查给定文件是否为符号链接。

代码示例

代码示例来源:origin: iterate-ch/cyberduck

@Override
public EnumSet<Type> getType() {
  final EnumSet<Type> set = EnumSet.noneOf(Type.class);
  if(this.isDirectory()) {
    set.add(Type.directory);
    if(this.isVolume()) {
      set.add(Type.volume);
    }
  }
  else {
    set.add(Type.file);
  }
  if(this.isSymbolicLink()) {
    set.add(Type.symboliclink);
  }
  return set;
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
public List<TransferItem> list(final Session<?> session, final Path remote,
                final Local directory, final ListProgressListener listener) throws BackgroundException {
  if(log.isDebugEnabled()) {
    log.debug(String.format("List children for %s", directory));
  }
  if(directory.isSymbolicLink()) {
    final Symlink symlink = session.getFeature(Symlink.class);
    if(new UploadSymlinkResolver(symlink, roots).resolve(directory)) {
      if(log.isDebugEnabled()) {
        log.debug(String.format("Do not list children for symbolic link %s", directory));
      }
      // We can resolve the target of the symbolic link and will create a link on the remote system
      // using the symlink feature of the session
      return Collections.emptyList();
    }
  }
  final List<TransferItem> children = new ArrayList<TransferItem>();
  for(Local local : directory.list().filter(comparator, filter)) {
    children.add(new TransferItem(new Path(remote, local.getName(),
        local.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), local));
  }
  return children;
}

代码示例来源:origin: iterate-ch/cyberduck

protected NSBundle bundle(final NSBundle main, Local executable) {
    if(!executable.isSymbolicLink()) {
      return main;
    }
    while(executable.isSymbolicLink()) {
      try {
        executable = executable.getSymlinkTarget();
      }
      catch(NotfoundException e) {
        return main;
      }
    }
    Local folder = executable.getParent();
    NSBundle b;
    do {
      b = NSBundle.bundleWithPath(folder.getAbsolute());
      if(null == b) {
        log.error(String.format("Loading bundle %s failed", folder));
        break;
      }
      if(StringUtils.equals(String.valueOf(Path.DELIMITER), b.bundlePath())) {
        break;
      }
      folder = folder.getParent();
    }
    while(b.executablePath() == null);
    return b;
  }
}

代码示例来源:origin: iterate-ch/cyberduck

log.debug(String.format("Transfer file %s with options %s", file, options));
if(local.isSymbolicLink()) {
  final Symlink feature = source.getFeature(Symlink.class);
  final UploadSymlinkResolver symlinkResolver

代码示例来源:origin: iterate-ch/cyberduck

if(local.isSymbolicLink()) {
  if(!symlinkResolver.resolve(local)) {

相关文章