@Override public void createLink(Path link, Path existing) throws IOException { delegate.createLink(resolveRelative(link), resolveRelative(existing)); }
@Test @Category( { HardLink.class, Writable.class } ) public void testHardLinkOfDifferentProvider() throws IOException { assertThatThrownBy( () -> FS.provider().createLink( otherProviderAbsA(), fileTA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Override public void createLink(final Path link, final Path existing) throws IOException { wrapped().createLink(unwrap(link), unwrap(existing)); }
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); } }
@Test( expected = ClosedFileSystemException.class ) @Category( Closable.class ) public void testClosedFSCreateHardLink() throws IOException { getClosedFSProvider().createLink( getClosedFileA(), getClosedFileA() ); }