use of org.eclipse.winery.repository.datatypes.ids.elements.DirectoryId in project winery by eclipse.
the class ToscaExportUtil method prepareForExport.
/**
* Determines the referenced definition children Ids and also updates the references in the Artifact Template
*
* @return a collection of referenced definition child Ids
*/
protected void prepareForExport(IRepository repository, ArtifactTemplateId id) throws IOException {
// Export files
// This method is called BEFORE the concrete definitions element is written.
// Therefore, we adapt the content of the attached files to the really existing files
BackendUtils.synchronizeReferences(repository, id);
DirectoryId fileDir = new ArtifactTemplateFilesDirectoryId(id);
SortedSet<RepositoryFileReference> files = repository.getContainedFiles(fileDir);
for (RepositoryFileReference ref : files) {
// Even if writing a TOSCA only (!this.writingCSAR),
// we put the virtual path in the TOSCA
// Reason: Winery is mostly used as a service and local storage
// reference to not make sense
// The old implementation had absolutePath.toUri().toString();
// there, but this does not work when using a cloud blob store.
putRefAsReferencedItemInCsar(repository, ref);
}
}
Aggregations