From 98615296641c1cabc245d270fb852e1ab8c55da8 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Thu, 9 Jul 2020 14:10:50 -0700 Subject: [PATCH] Added an exception to unsupported provider methods instead of no-op'ing or returning null (#12977) --- .../storage/blob/nio/AzureFileSystemProvider.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java index 4be316c90c83..c212b1b35c35 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -199,12 +199,13 @@ public Path getPath(URI uri) { } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public SeekableByteChannel newByteChannel(Path path, Set set, FileAttribute... fileAttributes) throws IOException { - return null; + throw new UnsupportedOperationException(); } /** @@ -611,19 +612,21 @@ public void copy(Path source, Path destination, CopyOption... copyOptions) throw }*/ /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public void move(Path path, Path path1, CopyOption... copyOptions) throws IOException { - + throw new UnsupportedOperationException(); } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public boolean isSameFile(Path path, Path path1) throws IOException { - return false; + throw new UnsupportedOperationException(); } /** @@ -635,19 +638,21 @@ public boolean isHidden(Path path) throws IOException { } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public FileStore getFileStore(Path path) throws IOException { - return null; + throw new UnsupportedOperationException(); } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public void checkAccess(Path path, AccessMode... accessModes) throws IOException { - + throw new UnsupportedOperationException(); } /**