Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit d014f70

Browse files
committed
Implement S3FileSystemProvider.move() simply with copy() and delete()
1 parent 650d7b6 commit d014f70

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/com/upplication/s3fs/S3FileSystemProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ public void copy(Path source, Path target, CopyOption... options) throws IOExcep
395395

396396
@Override
397397
public void move(Path source, Path target, CopyOption... options) throws IOException {
398-
throw new UnsupportedOperationException();
398+
copy(source, target, options);
399+
delete(source);
399400
}
400401

401402
@Override

src/test/java/com/upplication/s3fs/S3FileSystemProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ public void copyAlreadyExists() throws IOException {
922922
s3fsProvider.copy(file, fileDest);
923923
}
924924

925-
@Test(expected = UnsupportedOperationException.class)
925+
@Test
926926
public void move() throws IOException {
927927
// fixtures
928928
AmazonS3ClientMock client = AmazonS3MockFactory.getAmazonClientMock();

0 commit comments

Comments
 (0)