docs: private void writeMetadataFile(Path directoryPath,
                                     FileSystem outputFs,
                                     String metadataFileName,
                                     ReadOnlyStorageMetadata metadata) throws IOException {
          Path metadataPath = new Path(directoryPath, metadataFileName);
          FSDataOutputStream metadataStream = outputFs.create(metadataPath);
          outputFs.setPermission(metadataPath, new FsPermission(HADOOP_FILE_PERMISSION));
          metadataStream.write(metadata.toJsonString().getBytes());
          metadataStream.flush();
          metadataStream.close();
      }