code: private void buildPackageMetadata() throws IOException {
      metadata.validate();
      buildTemplatedMetadataFile(META_DIR + "/" + CONFIG_XML);
      buildPropertiesFile(META_DIR + "/" + PROPERTIES_XML);
      buildTemplatedMetadataFile(META_DIR + "/" + SETTINGS_XML);
      buildTemplatedMetadataFile(META_DIR + "/" + PACKAGE_DEFINITION_XML);
      writeXmlDocument(META_DIR + "/" + FILTER_XML, xmlContentBuilder.buildFilter(metadata.getFilters()));
  
      // package thumbnail
      byte[] thumbnailImage = metadata.getThumbnailImage();
      if (thumbnailImage != null) {
        zip.putNextEntry(new ZipEntry(META_DIR + "/definition/thumbnail.png"));
        try {
          zip.write(thumbnailImage);
        }
        finally {
          zip.closeEntry();
        }
      }
    }
docs: Build all package metadata files based on templates.
  @throws IOException I/O exception