@Override public void move(Path source, Path target, CopyOption... options) throws IOException { Path s = unroot(source); Path t = unroot(target); if (log.isTraceEnabled()) { log.trace("move({})[{}]: {}[{}]", source, s, target, t); } FileSystemProvider p = provider(s); p.move(s, t, options); }
@Override public void move(Path source, Path target, CopyOption... options) throws IOException { Path s = unroot(source); Path t = unroot(target); if (log.isTraceEnabled()) { log.trace("move({})[{}]: {}[{}]", source, s, target, t); } FileSystemProvider p = provider(s); p.move(s, t, options); }
@Override public void move(Path source, Path target, CopyOption... options) throws IOException { delegate.move(resolveRelative(source), resolveRelative(target), options); }
@Override public void move(Path source, Path target, CopyOption... options) throws IOException { Path s = unroot(source); Path t = unroot(target); FileSystemProvider p = provider(s); p.move(s, t, options); }
@Test @Category( { Move.class, Writable.class } ) public void testMoveOtherProviderFrom() throws IOException { assertThatThrownBy( () -> FS.provider().move( otherProviderAbsA(), absTA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Test @Category( { Copy.class, Writable.class } ) public void testMoveOtherProviderTo() throws IOException { assertThatThrownBy( () -> FS.provider().move( fileTAB(), otherProviderAbsA() ) ).isInstanceOf( ProviderMismatchException.class ); }
@Override public void move(final Path source, final Path target, final CopyOption... options) throws IOException {wrapped().move(unwrap(source), unwrap(target), options);}
@Test @Category( { Move.class, Writable.class } ) public void testMoveToUnnormalizedPath() throws IOException { FS.provider().move( srcFile(), unnormalize( tgt() ) ); assertThat( Files.readAllBytes( tgt() ) ).isEqualTo( CONTENT ); }
@Test @Category( { Writable.class, Move.class } ) public void testMoveViaProvider() throws IOException { srcFile().getFileSystem().provider().move( src(), tgt() ); assertThat( src() ).doesNotExist(); }
.getDefault() .provider() .move(Paths.get(mergeFiles.get(0).toURI()), Paths.get(outputFile.toURI()), StandardCopyOption.REPLACE_EXISTING);
@Test @Category( { Move.class, Writable.class } ) public void testMoveUnnormalizedPath() throws IOException { FS.provider().move( unnormalize( srcFile() ), tgt() ); assertThat( Files.readAllBytes( tgt() ) ).isEqualTo( CONTENT ); }
@Test( expected = ClosedFileSystemException.class ) @Category({ Closable.class, Writable.class, Move.class }) public void testMoveToClosedFS() throws IOException { getClosedFSProvider().move( fileTA(), getClosedFileA() ); }
@Test @Category( { SecondFileSystem.class, Copy.class } ) public void testMoveToDifferentFS() throws IOException { Path src = fileTA(); FS.provider().move( src, otherFSabsTA() ); assertThat( otherFSabsTA() ).exists(); assertThat( absTA() ).doesNotExist(); }