@Override public void copy(Path source, Path target, CopyOption... options) throws IOException { Path s = unroot(source); Path t = unroot(target); if (log.isTraceEnabled()) { log.trace("copy({})[{}]: {}[{}]", source, s, target, t); } FileSystemProvider p = provider(s); p.copy(s, t, options); }
@Override public void copy(Path source, Path target, CopyOption... options) throws IOException { Path s = unroot(source); Path t = unroot(target); if (log.isTraceEnabled()) { log.trace("copy({})[{}]: {}[{}]", source, s, target, t); } FileSystemProvider p = provider(s); p.copy(s, t, options); }
@Override public void copy(Path source, Path target, CopyOption... options) throws IOException { delegate.copy(resolveRelative(source), resolveRelative(target), options); }
@Override public void move(Path source, Path target, CopyOption... options) throws IOException { BundleFileSystem fs = (BundleFileSystem) source.getFileSystem(); origProvider(source) .copy(fs.unwrap(source), fs.unwrap(target), options); }
@Override public void copy(Path source, Path target, CopyOption... options) throws IOException { BundleFileSystem fs = (BundleFileSystem) source.getFileSystem(); origProvider(source) .copy(fs.unwrap(source), fs.unwrap(target), options); }
@Override public void copy(Path source, Path target, CopyOption... options) throws IOException { Path s = unroot(source); Path t = unroot(target); FileSystemProvider p = provider(s); p.copy(s, t, options); }
@Test @Category( { Copy.class, Writable.class } ) public void testCopyOtherProviderFrom() throws IOException { assertThatThrownBy( () -> FS.provider().copy( otherProviderAbsA(), absTA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Test @Category( { Copy.class, Writable.class } ) public void testCopyOtherProviderTo() throws IOException { assertThatThrownBy( () -> FS.provider().copy( fileTA(), otherProviderAbsA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Override public void copy(final Path source, final Path target, final CopyOption... options) throws IOException {wrapped().copy(unwrap(source), unwrap(target), options);}
@Test @Category( { Writable.class, Copy.class } ) public void testCopyViaProvider() throws IOException { srcFile().getFileSystem().provider().copy( srcFile(), tgt() ); assertThat( Files.readAllBytes( tgt() ) ).isEqualTo( CONTENT ); }
@Test @Category( { Copy.class, Writable.class } ) public void testCopyUnnormalizedPath() throws IOException { FS.provider().copy( unnormalize( srcFile() ), tgt() ); assertThat( Files.readAllBytes( tgt() ) ).isEqualTo( CONTENT ); }
@Test @Category( { Copy.class, Writable.class } ) public void testCopyToUnnormalizedPath() throws IOException { FS.provider().copy( srcFile(), unnormalize( tgt() ) ); assertThat( Files.readAllBytes( tgt() ) ).isEqualTo( CONTENT ); }
@Test @Category( { SecondFileSystem.class, Copy.class } ) public void testCopyToDifferentFS() throws IOException { Path src = fileTA(); FS.provider().copy( src, otherFSabsTA() ); assertThat( otherFSabsTA() ).exists(); }
@Test( expected = ClosedFileSystemException.class ) @Category({ Closable.class, Writable.class }) public void testCopyFromClosedFS() throws IOException { getClosedFSProvider().copy( getClosedFileA(), dirTA() ); }
@Test( expected = ClosedFileSystemException.class ) @Category({ Closable.class, Writable.class }) public void testCopyToClosedFS() throws IOException { getClosedFSProvider().copy( fileTA(), getClosedFileA() ); }