@Override public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException { delegate.createSymbolicLink(resolveRelative(link), resolveRelative(target), attrs); }
@Test @Category( { Writable.class, SymLink.class } ) public void testCreateSymLinkToPathFromOtherProvider() throws IOException { assertThatThrownBy( () -> FS.provider().createSymbolicLink( dirTA().resolve( "link" ), otherProviderAbsA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Test @Category( { Writable.class, SymLink.class } ) public void testCreateSymLinkFromOtherProviderPath() throws IOException { assertThatThrownBy( () -> FS.provider().createSymbolicLink( otherProviderAbsA(), fileTA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Override public void createSymbolicLink(final Path link, final Path target, final FileAttribute<?>[] attrs) throws IOException { wrapped().createSymbolicLink(unwrap(link), unwrap(target), attrs); }
protected void createLink(Path link, Path target, boolean symLink, FileAttribute<?>... attrs) throws IOException { Path l = unroot(link); Path t = unroot(target); /* * For a symbolic link preserve the relative path */ if (symLink && (!target.isAbsolute())) { RootedFileSystem rfs = ((RootedPath) target).getFileSystem(); Path root = rfs.getRoot(); t = root.relativize(t); } FileSystemProvider p = provider(l); if (symLink) { p.createSymbolicLink(l, t, attrs); } else { p.createLink(l, t); } if (log.isDebugEnabled()) { log.debug("createLink(symbolic={}) {} => {}", symLink, l, t); } }
protected void createLink(Path link, Path target, boolean symLink, FileAttribute<?>... attrs) throws IOException { Path l = unroot(link); Path t = unroot(target); /* * For a symbolic link preserve the relative path */ if (symLink && (!target.isAbsolute())) { RootedFileSystem rfs = ((RootedPath) target).getFileSystem(); Path root = rfs.getRoot(); t = root.relativize(t); } FileSystemProvider p = provider(l); if (symLink) { p.createSymbolicLink(l, t, attrs); } else { p.createLink(l, t); } if (log.isDebugEnabled()) { log.debug("createLink(symbolic={}) {} => {}", symLink, l, t); } }
protected void createLink(Path link, Path target, boolean symLink, FileAttribute<?>... attrs) throws IOException { Path l = unroot(link); Path t = unroot(target); /* * For a symbolic link preserve the relative path */ if (symLink && (!target.isAbsolute())) { RootedFileSystem rfs = ((RootedPath) target).getFileSystem(); Path root = rfs.getRoot(); t = root.relativize(t); } FileSystemProvider p = provider(l); if (symLink) { p.createSymbolicLink(l, t, attrs); } else { p.createLink(l, t); } }