```php
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($uri);
if($storage instanceof \OC\Files\Storage\Shared){
...
}
```

I prefer not to rely on the *magic* "Shared"