Skip to content

Commit

Permalink
Added an exception to unsupported provider methods instead of no-op'i…
Browse files Browse the repository at this point in the history
…ng or returning null (#12977)
  • Loading branch information
rickle-msft authored Jul 9, 2020
1 parent feaf5d4 commit 9861529
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ public Path getPath(URI uri) {
}

/**
* @throws UnsupportedOperationException Operation is not supported.
* {@inheritDoc}
*/
@Override
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> set,
FileAttribute<?>... fileAttributes) throws IOException {
return null;
throw new UnsupportedOperationException();
}

/**
Expand Down Expand Up @@ -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();
}

/**
Expand All @@ -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();
}

/**
Expand Down

0 comments on commit 9861529

Please sign in to comment.