test_class.file: org.eclipse.winery.repository/src/test/java/org/eclipse/winery/repository/export/CsarExporterTest.java
test_class.identifier: CsarExporterTest
test_class.superclass: extends TestWithGitBackedRepository
test_case.body: @Test
      @Disabled
      // todo check how to enable
      public void testPutCsarInBlockchainAndImmutableStorage() throws Exception {
          setRevisionTo("origin/plain");
          CsarExporter exporter = new CsarExporter();
          DefinitionsChildId id = new ServiceTemplateId("http://plain.winery.opentosca.org/servicetemplates", "ServiceTemplateWithAllReqCapVariants", false);
          ByteArrayOutputStream os = new ByteArrayOutputStream();
  
          CompletableFuture<String> future = exporter.writeCsarAndSaveManifestInProvenanceLayer(RepositoryFactory.getRepository(), id, os);
          String transactionHash = future.get();
  
          assertNotNull(transactionHash);
  
          try (InputStream inputStream = new ByteArrayInputStream(os.toByteArray());
               ZipInputStream zis = new ZipInputStream(inputStream)) {
              ManifestContents manifestContents = parseManifest(zis);
  
              assertNotNull(manifestContents);
  
              for (String section : manifestContents.getSectionNames()) {
                  assertNotNull(manifestContents.getAttributesForSection(section).get(TOSCAMetaFileAttributes.IMMUTABLE_ADDRESS));
              }
          }
      }
test_case.class_method_signature: CsarExporterTest.testPutCsarInBlockchainAndImmutableStorage()
test_case.full_signature: @Test @Disabled // todo check how to enable public void testPutCsarInBlockchainAndImmutableStorage()
test_case.identifier: testPutCsarInBlockchainAndImmutableStorage
test_case.invocations: setRevisionTo writeCsarAndSaveManifestInProvenanceLayer getRepository get assertNotNull toByteArray parseManifest assertNotNull getSectionNames assertNotNull get getAttributesForSection
test_case.modifiers: @Test @Disabled // todo check how to enable public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPutCsarInBlockchainAndImmutableStorage()
focal_class.declarator: PATH_TO_NAMESPACES_PROPERTIES = "winery/Namespaces.properties"
focal_class.modifier: public static final
focal_class.original_string: public static final String PATH_TO_NAMESPACES_PROPERTIES = "winery/Namespaces.properties";
focal_class.type: String
focal_class.var_name: PATH_TO_NAMESPACES_PROPERTIES
focal_class.declarator: PATH_TO_NAMESPACES_JSON = "winery/Namespaces.json"
focal_class.modifier: public static final
focal_class.original_string: public static final String PATH_TO_NAMESPACES_JSON = "winery/Namespaces.json";
focal_class.type: String
focal_class.var_name: PATH_TO_NAMESPACES_JSON
focal_class.declarator: LOGGER = LoggerFactory.getLogger(CsarExporter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(CsarExporter.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: DEFINITONS_PATH_PREFIX = "Definitions/"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFINITONS_PATH_PREFIX = "Definitions/";
focal_class.type: String
focal_class.var_name: DEFINITONS_PATH_PREFIX
focal_class.declarator: WINERY_TEMP_DIR_PREFIX = "winerytmp"
focal_class.modifier: private static final
focal_class.original_string: private static final String WINERY_TEMP_DIR_PREFIX = "winerytmp";
focal_class.type: String
focal_class.var_name: WINERY_TEMP_DIR_PREFIX
focal_class.file: org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/export/CsarExporter.java
focal_class.identifier: CsarExporter
focal_class.class_method_signature: CsarExporter.getDefinitionsName(IRepository repository, DefinitionsChildId id)
focal_class.full_signature: private static String getDefinitionsName(IRepository repository, DefinitionsChildId id)
focal_class.identifier: getDefinitionsName
focal_class.modifiers: private static
focal_class.parameters: (IRepository repository, DefinitionsChildId id)
focal_class.return: String
focal_class.signature: String getDefinitionsName(IRepository repository, DefinitionsChildId id)
focal_class.class_method_signature: CsarExporter.getDefinitionsFileName(IRepository repository, DefinitionsChildId id)
focal_class.full_signature: public static String getDefinitionsFileName(IRepository repository, DefinitionsChildId id)
focal_class.identifier: getDefinitionsFileName
focal_class.modifiers: public static
focal_class.parameters: (IRepository repository, DefinitionsChildId id)
focal_class.return: String
focal_class.signature: String getDefinitionsFileName(IRepository repository, DefinitionsChildId id)
focal_class.class_method_signature: CsarExporter.getDefinitionsPathInsideCSAR(IRepository repository, DefinitionsChildId id)
focal_class.full_signature: private static String getDefinitionsPathInsideCSAR(IRepository repository, DefinitionsChildId id)
focal_class.identifier: getDefinitionsPathInsideCSAR
focal_class.modifiers: private static
focal_class.parameters: (IRepository repository, DefinitionsChildId id)
focal_class.return: String
focal_class.signature: String getDefinitionsPathInsideCSAR(IRepository repository, DefinitionsChildId id)
focal_class.class_method_signature: CsarExporter.writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_class.full_signature: public CompletableFuture<String> writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_class.identifier: writeCsarAndSaveManifestInProvenanceLayer
focal_class.modifiers: public
focal_class.parameters: (IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_class.return: CompletableFuture<String>
focal_class.signature: CompletableFuture<String> writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_class.class_method_signature: CsarExporter.writeCsar(IRepository repository, DefinitionsChildId entryId, OutputStream out, Map<String, Object> exportConfiguration)
focal_class.full_signature: public String writeCsar(IRepository repository, DefinitionsChildId entryId, OutputStream out, Map<String, Object> exportConfiguration)
focal_class.identifier: writeCsar
focal_class.modifiers: public
focal_class.parameters: (IRepository repository, DefinitionsChildId entryId, OutputStream out, Map<String, Object> exportConfiguration)
focal_class.return: String
focal_class.signature: String writeCsar(IRepository repository, DefinitionsChildId entryId, OutputStream out, Map<String, Object> exportConfiguration)
focal_class.class_method_signature: CsarExporter.calculateFileHashes(Map<CsarContentProperties, CsarEntry> files)
focal_class.full_signature: private void calculateFileHashes(Map<CsarContentProperties, CsarEntry> files)
focal_class.identifier: calculateFileHashes
focal_class.modifiers: private
focal_class.parameters: (Map<CsarContentProperties, CsarEntry> files)
focal_class.return: void
focal_class.signature: void calculateFileHashes(Map<CsarContentProperties, CsarEntry> files)
focal_class.class_method_signature: CsarExporter.immutablyStoreRefFiles(Map<CsarContentProperties, CsarEntry> filesToStore, IRepository repository)
focal_class.full_signature: private void immutablyStoreRefFiles(Map<CsarContentProperties, CsarEntry> filesToStore, IRepository repository)
focal_class.identifier: immutablyStoreRefFiles
focal_class.modifiers: private
focal_class.parameters: (Map<CsarContentProperties, CsarEntry> filesToStore, IRepository repository)
focal_class.return: void
focal_class.signature: void immutablyStoreRefFiles(Map<CsarContentProperties, CsarEntry> filesToStore, IRepository repository)
focal_class.class_method_signature: CsarExporter.addArtifactTemplateToZipFile(ZipOutputStream zos, RepositoryRefBasedCsarEntry csarEntry,
                                                  CsarContentProperties fileProperties)
focal_class.full_signature: protected void addArtifactTemplateToZipFile(ZipOutputStream zos, RepositoryRefBasedCsarEntry csarEntry,
                                                  CsarContentProperties fileProperties)
focal_class.identifier: addArtifactTemplateToZipFile
focal_class.modifiers: protected
focal_class.parameters: (ZipOutputStream zos, RepositoryRefBasedCsarEntry csarEntry,
                                                  CsarContentProperties fileProperties)
focal_class.return: void
focal_class.signature: void addArtifactTemplateToZipFile(ZipOutputStream zos, RepositoryRefBasedCsarEntry csarEntry,
                                                  CsarContentProperties fileProperties)
focal_class.class_method_signature: CsarExporter.addCsarEntryToArchive(ZipOutputStream zos, CsarEntry csarEntry,
                                         CsarContentProperties csarContentProperties)
focal_class.full_signature: private void addCsarEntryToArchive(ZipOutputStream zos, CsarEntry csarEntry,
                                         CsarContentProperties csarContentProperties)
focal_class.identifier: addCsarEntryToArchive
focal_class.modifiers: private
focal_class.parameters: (ZipOutputStream zos, CsarEntry csarEntry,
                                         CsarContentProperties csarContentProperties)
focal_class.return: void
focal_class.signature: void addCsarEntryToArchive(ZipOutputStream zos, CsarEntry csarEntry,
                                         CsarContentProperties csarContentProperties)
focal_class.class_method_signature: CsarExporter.deleteDirectory(Path path)
focal_class.full_signature: private void deleteDirectory(Path path)
focal_class.identifier: deleteDirectory
focal_class.modifiers: private
focal_class.parameters: (Path path)
focal_class.return: void
focal_class.signature: void deleteDirectory(Path path)
focal_class.class_method_signature: CsarExporter.addWorkingTreeToArchive(ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.full_signature: private void addWorkingTreeToArchive(ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.identifier: addWorkingTreeToArchive
focal_class.modifiers: private
focal_class.parameters: (ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.return: void
focal_class.signature: void addWorkingTreeToArchive(ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.class_method_signature: CsarExporter.addWorkingTreeToArchive(File file, ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.full_signature: private void addWorkingTreeToArchive(File file, ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.identifier: addWorkingTreeToArchive
focal_class.modifiers: private
focal_class.parameters: (File file, ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.return: void
focal_class.signature: void addWorkingTreeToArchive(File file, ZipOutputStream zos, TArtifactTemplate template, Path rootDir, String archivePath)
focal_class.class_method_signature: CsarExporter.addNamespacePrefixes(IRepository repository, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.full_signature: private void addNamespacePrefixes(IRepository repository, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.identifier: addNamespacePrefixes
focal_class.modifiers: private
focal_class.parameters: (IRepository repository, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.return: void
focal_class.signature: void addNamespacePrefixes(IRepository repository, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.class_method_signature: CsarExporter.addSelfServiceMetaData(IRepository repository, ServiceTemplateId entryId, String targetDir, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.full_signature: private void addSelfServiceMetaData(IRepository repository, ServiceTemplateId entryId, String targetDir, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.identifier: addSelfServiceMetaData
focal_class.modifiers: private
focal_class.parameters: (IRepository repository, ServiceTemplateId entryId, String targetDir, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.return: void
focal_class.signature: void addSelfServiceMetaData(IRepository repository, ServiceTemplateId entryId, String targetDir, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.class_method_signature: CsarExporter.putRefIntoRefMap(String targetDir, Map<CsarContentProperties, CsarEntry> refMap, IRepository repository, GenericId id, String fileName)
focal_class.full_signature: private void putRefIntoRefMap(String targetDir, Map<CsarContentProperties, CsarEntry> refMap, IRepository repository, GenericId id, String fileName)
focal_class.identifier: putRefIntoRefMap
focal_class.modifiers: private
focal_class.parameters: (String targetDir, Map<CsarContentProperties, CsarEntry> refMap, IRepository repository, GenericId id, String fileName)
focal_class.return: void
focal_class.signature: void putRefIntoRefMap(String targetDir, Map<CsarContentProperties, CsarEntry> refMap, IRepository repository, GenericId id, String fileName)
focal_class.class_method_signature: CsarExporter.addLicenseAndReadmeFiles(IRepository repository, DefinitionsChildId entryId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.full_signature: protected void addLicenseAndReadmeFiles(IRepository repository, DefinitionsChildId entryId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.identifier: addLicenseAndReadmeFiles
focal_class.modifiers: protected
focal_class.parameters: (IRepository repository, DefinitionsChildId entryId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.return: void
focal_class.signature: void addLicenseAndReadmeFiles(IRepository repository, DefinitionsChildId entryId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.class_method_signature: CsarExporter.addSelfServiceMetaData(IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.full_signature: private void addSelfServiceMetaData(IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.identifier: addSelfServiceMetaData
focal_class.modifiers: private
focal_class.parameters: (IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.return: void
focal_class.signature: void addSelfServiceMetaData(IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.class_method_signature: CsarExporter.addSelfServiceFiles(IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.full_signature: private void addSelfServiceFiles(IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.identifier: addSelfServiceFiles
focal_class.modifiers: private
focal_class.parameters: (IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.return: void
focal_class.signature: void addSelfServiceFiles(IRepository repository, ServiceTemplateId serviceTemplateId, Map<CsarContentProperties, CsarEntry> refMap)
focal_class.class_method_signature: CsarExporter.addManifest(IRepository repository, DefinitionsChildId id, Map<CsarContentProperties, CsarEntry> refMap,
                                 ZipOutputStream out, Map<String, Object> exportConfiguration)
focal_class.full_signature: private String addManifest(IRepository repository, DefinitionsChildId id, Map<CsarContentProperties, CsarEntry> refMap,
                                 ZipOutputStream out, Map<String, Object> exportConfiguration)
focal_class.identifier: addManifest
focal_class.modifiers: private
focal_class.parameters: (IRepository repository, DefinitionsChildId id, Map<CsarContentProperties, CsarEntry> refMap,
                                 ZipOutputStream out, Map<String, Object> exportConfiguration)
focal_class.return: String
focal_class.signature: String addManifest(IRepository repository, DefinitionsChildId id, Map<CsarContentProperties, CsarEntry> refMap,
                                 ZipOutputStream out, Map<String, Object> exportConfiguration)
focal_method.body: public CompletableFuture<String> writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
          throws IOException, RepositoryCorruptException, AccountabilityException, InterruptedException, ExecutionException {
          LocalDateTime start = LocalDateTime.now();
          AccountabilityManager accountabilityManager = AccountabilityManagerFactory.getAccountabilityManager();
  
          Map<String, Object> exportConfiguration = new HashMap<>();
          exportConfiguration.put(CsarExportConfiguration.INCLUDE_HASHES.name(), null);
          exportConfiguration.put(CsarExportConfiguration.STORE_IMMUTABLY.name(), null);
  
          String manifestString = this.writeCsar(repository, entryId, out, exportConfiguration);
          String qNameWithComponentVersionOnly = VersionUtils.getQNameWithComponentVersionOnly(entryId);
          LOGGER.debug("Preparing CSAR export (provenance) lasted {}", Duration.between(LocalDateTime.now(), start).toString());
  
          return accountabilityManager.storeFingerprint(qNameWithComponentVersionOnly, manifestString);
      }
focal_method.class_method_signature: CsarExporter.writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_method.full_signature: public CompletableFuture<String> writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_method.identifier: writeCsarAndSaveManifestInProvenanceLayer
focal_method.invocations: now getAccountabilityManager put name put name writeCsar getQNameWithComponentVersionOnly debug toString between now storeFingerprint
focal_method.modifiers: public
focal_method.parameters: (IRepository repository, DefinitionsChildId entryId, OutputStream out)
focal_method.return: CompletableFuture<String>
focal_method.signature: CompletableFuture<String> writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)