docs: @NonNull
      public static File getFileForUri(@NonNull Uri uri) {
          String path = uri.getEncodedPath();
          final int splitIndex = path.indexOf('/', 1);
          final String tag = Uri.decode(path.substring(1, splitIndex));
          path = Uri.decode(path.substring(splitIndex + 1));
  
          if (!"root".equalsIgnoreCase(tag)) {
              throw new IllegalArgumentException(
                      String.format("Can't decode paths to '%s', only for 'root' paths.",
                              tag));
          }
  
          final File root = new File("/");
  
          File file = new File(root, path);
          try {
              file = file.getCanonicalFile();
          } catch (IOException e) {
              throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
          }
  
          if (!file.getPath().startsWith(root.getPath())) {
              throw new SecurityException("Resolved path jumped beyond configured root");
          }
  
          return file;
      }