@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; }
@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; }
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; } }
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
if(local.isSymbolicLink()) { if(!symlinkResolver.resolve(local)) {