Throw IoException when basePath is not contained within path.