@Override public boolean resolve(final Path file) { if(PreferencesFactory.get().getBoolean("path.symboliclink.resolve")) { // Follow links instead return false; } // Create symbolic link only if supported by the local file system if(feature != null) { final Path target = file.getSymlinkTarget(); // Only create symbolic link if target is included in the download for(TransferItem root : files) { if(this.findTarget(target, root.remote)) { if(log.isDebugEnabled()) { log.debug(String.format("Resolved target %s for %s", target, file)); } // Create symbolic link return true; } } } // Otherwise download target file return false; }
for(final Path file : list) { if(file.isSymbolicLink()) { final Path target = file.getSymlinkTarget(); if(session.getClient().changeWorkingDirectory(file.getAbsolute())) { file.setType(EnumSet.of(Path.Type.directory, Path.Type.symboliclink));
file.getSymlinkTarget().getAbsolute()); if(log.isDebugEnabled()) { log.debug(String.format("Create symbolic link from %s to %s", local, target));
public AbstractEditor(final Application application, final SessionPool session, final Path file, final ApplicationLauncher launcher, final ApplicationFinder finder, final ProgressListener listener) { this.applicationLauncher = launcher; this.applicationFinder = finder; this.application = application; if(file.isSymbolicLink() && PreferencesFactory.get().getBoolean("editor.upload.symboliclink.resolve")) { this.remote = file.getSymlinkTarget(); } else { this.remote = file; } this.local = TemporaryFileServiceFactory.get().create(session.getHost().getUuid(), remote); this.session = session; this.listener = listener; }
if(file.isSymbolicLink()) { final Path target = file.getSymlinkTarget();
path = file.getSymlinkTarget().getAbsolute();
@Override public void visit(final AttributedList<Path> list, final int index, final Path file) { if(l) { if(file.isSymbolicLink()) { console.printf("%n%sl%s\t%s\t%s -> %s%s", Ansi.ansi().bold(), file.attributes().getPermission().getSymbol(), formatter.getMediumFormat( file.attributes().getModificationDate()), file.getName(), file.getSymlinkTarget().getAbsolute(), Ansi.ansi().reset()); } else { console.printf("%n%s%s%s\t%s\t%s\t%s%s", Ansi.ansi().bold(), file.isDirectory() ? "d" : "-", file.attributes().getPermission().getSymbol(), formatter.getMediumFormat( file.attributes().getModificationDate()), StringUtils.isNotBlank(file.attributes().getRegion()) ? file.attributes().getRegion() : StringUtils.EMPTY, file.getName(), Ansi.ansi().reset()); } } else { console.printf("%n%s%s%s", Ansi.ansi().bold(), file.getName(), Ansi.ansi().reset()); } }