Search in sources :

Example 96 with Files

use of java.nio.file.Files in project ddf by codice.

the class FileSystemStorageProvider method getContentFilePath.

private Path getContentFilePath(URI uri) throws StorageException {
    Path contentIdDir = getContentItemDir(uri);
    List<Path> contentFiles;
    if (contentIdDir != null && contentIdDir.toFile().exists()) {
        try {
            contentFiles = listPaths(contentIdDir);
        } catch (IOException e) {
            throw new StorageException(e);
        }
        contentFiles.removeIf(Files::isDirectory);
        if (contentFiles.size() != 1) {
            throw new StorageException("Content ID: " + uri.getSchemeSpecificPart() + " storage folder is corrupted.");
        }
        // there should only be one file
        return contentFiles.get(0);
    }
    return null;
}
Also used : Path(java.nio.file.Path) IOException(java.io.IOException) Files(java.nio.file.Files) StorageException(ddf.catalog.content.StorageException)

Example 97 with Files

use of java.nio.file.Files in project CzechIdMng by bcvsolutions.

the class DefaultImportManager method removeRedundant.

/**
 * Ensures delete redundant entities in target IdM. Deletes DTOs are within
 * golden DTO type (super parent = typically system, role, ...).
 *
 * @param descriptor
 * @param context
 */
private void removeRedundant(ExportDescriptorDto descriptor, ImportContext context) {
    Class<? extends BaseDto> dtoClass = descriptor.getDtoClass();
    // Does this DTO support the authoritative mode?
    boolean supportsAuthoritativeMode = descriptor.isSupportsAuthoritativeMode();
    if (!supportsAuthoritativeMode) {
        return;
    }
    String superParentFilterProperty = descriptor.getSuperParentFilterProperty();
    Assert.notNull(superParentFilterProperty, "For authoritative mode must be superParentFilterProperty defined!");
    // Find super parent (gold) DTO (typically it is DTO for system, role ...)
    Class<? extends AbstractDto> superParentDtoClass = getSuperParentDtoClass(descriptor, context);
    Assert.notNull(superParentDtoClass, "Supper parent cannot be null here!");
    Path superParentDtoTypePath = Paths.get(context.getTempDirectory().toString(), superParentDtoClass.getSimpleName());
    try {
        // Find all super parent IDs for this DTO type in batch.
        Set<UUID> superParentIdsInBatch;
        try (Stream<Path> paths = Files.walk(superParentDtoTypePath)) {
            superParentIdsInBatch = // 
            paths.filter(// 
            Files::isRegularFile).map(path -> {
                BaseDto dto = convertFileToDto(path.toFile(), superParentDtoClass, context);
                return (UUID) dto.getId();
            }).collect(Collectors.toSet());
        }
        Set<Class<? extends BaseDto>> inheritedClasses = getInheritedClasses(dtoClass, context.getManifest());
        // Find all IDs for all children classes
        Set<Serializable> childrenIdsInBatch = Sets.newHashSet();
        for (Class<? extends BaseDto> inheritedClass : inheritedClasses) {
            // Find all IDs for this DTO type in batch.
            Path dtoTypePath = Paths.get(context.getTempDirectory().toString(), inheritedClass.getSimpleName());
            try (Stream<Path> paths = Files.walk(dtoTypePath)) {
                Set<Serializable> childrenIds = // 
                paths.filter(// 
                Files::isRegularFile).map(// 
                path -> convertFileToDto(path.toFile(), inheritedClass, context)).map(dto -> {
                    // If ID has been replaced, then we need to also replace it.
                    if (context.getReplacedIDs().containsKey((UUID) dto.getId())) {
                        return context.getReplacedIDs().get((UUID) dto.getId());
                    }
                    return dto.getId();
                }).collect(Collectors.toSet());
                childrenIdsInBatch.addAll(childrenIds);
            }
        }
        superParentIdsInBatch.forEach(superParentId -> {
            try {
                Class<? extends BaseDto> serviceDtoClass = dtoClass;
                if (dtoClass.isAnnotationPresent(Inheritable.class)) {
                    serviceDtoClass = dtoClass.getAnnotation(Inheritable.class).dtoService();
                }
                ReadWriteDtoService<BaseDto, BaseFilter> dtoService = getDtoService(serviceDtoClass);
                BaseFilter filterBase = dtoService.getFilterClass().getDeclaredConstructor().newInstance();
                // Fill super-parent-property by superParentId (call setter = check if filter is
                // implemented).
                new PropertyDescriptor(superParentFilterProperty, dtoService.getFilterClass()).getWriteMethod().invoke(filterBase, superParentId);
                // Load all IDs in IdM for this parent ID.
                List<UUID> childrenIdsInIdM = // 
                dtoService.find(filterBase, null).getContent().stream().map(// 
                childDto -> ((AbstractDto) childDto).getId()).collect(Collectors.toList());
                // IDs to delete = entities missing in the batch.
                Set<UUID> idsToDelete = // 
                childrenIdsInIdM.stream().filter(// 
                idmId -> !childrenIdsInBatch.contains(idmId)).collect(Collectors.toSet());
                idsToDelete.forEach(id -> {
                    BaseDto baseDto = dtoService.get(id);
                    IdmImportLogDto dtoLog = new IdmImportLogDto(context.getBatch(), baseDto, RequestOperationType.REMOVE, superParentId);
                    if (!context.isDryRun()) {
                        dtoService.delete(baseDto);
                        dtoLog.setResult(new OperationResultDto(OperationState.EXECUTED));
                    } else {
                        dtoLog.setResult(new OperationResultDto.Builder(OperationState.NOT_EXECUTED).setModel(// 
                        new DefaultResultModel(CoreResultCode.IMPORT_EXECUTED_AS_DRYRUN)).build());
                    }
                    importLogService.saveDistinct(dtoLog);
                });
            } catch (ReflectiveOperationException | IllegalArgumentException | IntrospectionException e) {
                throw new ResultCodeException(CoreResultCode.EXPORT_IMPORT_REFLECTION_FAILED, e);
            }
        });
    } catch (IOException e) {
        throw new ResultCodeException(CoreResultCode.EXPORT_IMPORT_IO_FAILED, e);
    }
}
Also used : Embedded(eu.bcvsolutions.idm.core.api.domain.Embedded) ImportContext(eu.bcvsolutions.idm.core.api.dto.ImportContext) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) IdmImportLogDto(eu.bcvsolutions.idm.core.api.dto.IdmImportLogDto) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) BasePermission(eu.bcvsolutions.idm.core.security.api.domain.BasePermission) JsonNode(com.fasterxml.jackson.databind.JsonNode) AbstractLongRunningTaskExecutor(eu.bcvsolutions.idm.core.scheduler.api.service.AbstractLongRunningTaskExecutor) AttachmentConfiguration(eu.bcvsolutions.idm.core.ecm.api.config.AttachmentConfiguration) Path(java.nio.file.Path) JsonParseException(com.fasterxml.jackson.core.JsonParseException) ImmutableMap(com.google.common.collect.ImmutableMap) ImportTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.ImportTaskExecutor) IdmImportLogFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmImportLogFilter) ReadWriteDtoService(eu.bcvsolutions.idm.core.api.service.ReadWriteDtoService) LongRunningFutureTask(eu.bcvsolutions.idm.core.scheduler.api.dto.LongRunningFutureTask) Set(java.util.Set) IdmExportImportService(eu.bcvsolutions.idm.core.api.service.IdmExportImportService) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) FileSystemUtils(org.springframework.util.FileSystemUtils) Sets(com.google.common.collect.Sets) IntrospectionException(java.beans.IntrospectionException) Serializable(java.io.Serializable) InvocationTargetException(java.lang.reflect.InvocationTargetException) Inheritable(eu.bcvsolutions.idm.core.api.domain.Inheritable) Objects(java.util.Objects) EmbeddedDto(eu.bcvsolutions.idm.core.api.dto.EmbeddedDto) List(java.util.List) Stream(java.util.stream.Stream) PropertyDescriptor(java.beans.PropertyDescriptor) CollectionUtils(org.springframework.util.CollectionUtils) Entry(java.util.Map.Entry) Strings(org.apache.logging.log4j.util.Strings) ExportImportType(eu.bcvsolutions.idm.core.api.domain.ExportImportType) ZipUtils(eu.bcvsolutions.idm.core.api.utils.ZipUtils) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) RequestOperationType(eu.bcvsolutions.idm.core.api.domain.RequestOperationType) ExportManager(eu.bcvsolutions.idm.core.api.service.ExportManager) ImportManager(eu.bcvsolutions.idm.core.api.service.ImportManager) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) AttachableEntity(eu.bcvsolutions.idm.core.ecm.api.entity.AttachableEntity) Session(org.hibernate.Session) MessageFormat(java.text.MessageFormat) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) IdmImportLogService(eu.bcvsolutions.idm.core.api.service.IdmImportLogService) Service(org.springframework.stereotype.Service) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) EntityUtils(eu.bcvsolutions.idm.core.api.utils.EntityUtils) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmExportImportDto(eu.bcvsolutions.idm.core.api.dto.IdmExportImportDto) Codeable(eu.bcvsolutions.idm.core.api.domain.Codeable) Files(java.nio.file.Files) LongRunningTaskManager(eu.bcvsolutions.idm.core.scheduler.api.service.LongRunningTaskManager) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) IOException(java.io.IOException) EntityManager(javax.persistence.EntityManager) Field(java.lang.reflect.Field) File(java.io.File) BaseFilter(eu.bcvsolutions.idm.core.api.dto.filter.BaseFilter) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) Paths(java.nio.file.Paths) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) ResultModel(eu.bcvsolutions.idm.core.api.dto.ResultModel) InputStream(java.io.InputStream) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) Serializable(java.io.Serializable) IntrospectionException(java.beans.IntrospectionException) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) BaseFilter(eu.bcvsolutions.idm.core.api.dto.filter.BaseFilter) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) IdmImportLogDto(eu.bcvsolutions.idm.core.api.dto.IdmImportLogDto) UUID(java.util.UUID) Path(java.nio.file.Path) PropertyDescriptor(java.beans.PropertyDescriptor) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) IOException(java.io.IOException)

Example 98 with Files

use of java.nio.file.Files in project vertx-docgen by vert-x3.

the class BaseProcessor method process.

@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    StackTraceElement[] trace = Thread.currentThread().getStackTrace();
    for (StackTraceElement elt : trace) {
        if (elt.getClassName().startsWith("org.jetbrains")) {
            return true;
        }
    }
    if (failures.isEmpty()) {
        try {
            if (!roundEnv.processingOver()) {
                roundEnv.getElementsAnnotatedWith(Document.class).forEach(elt -> {
                    try {
                        PackageDoc doc = new PackageDoc((PackageElement) elt);
                        state.put(doc, handleGen(doc));
                    } catch (DocGenException e) {
                        if (e.element == null) {
                            e.element = elt;
                        }
                        throw e;
                    }
                });
                if (sources != null && sources.size() > 0) {
                    for (String source : sources) {
                        // Handle wildcards
                        List<File> files = new ArrayList<>();
                        File f = new File(source);
                        if (!f.exists()) {
                            if (f.getName().contains("*")) {
                                StringBuilder sb = new StringBuilder();
                                for (char c : f.getName().toCharArray()) {
                                    if (c == '*') {
                                        sb.append(".*");
                                    } else {
                                        sb.append(Matcher.quoteReplacement(Character.toString(c)));
                                    }
                                }
                                Pattern p = Pattern.compile(sb.toString());
                                File parentFile = f.getParentFile();
                                File[] children = parentFile.listFiles();
                                if (children != null) {
                                    for (File child : children) {
                                        if (p.matcher(child.getName()).matches()) {
                                            files.add(child);
                                        }
                                    }
                                }
                            } else {
                                throw new FileNotFoundException("Cannot process document " + source);
                            }
                        } else {
                            files.add(f);
                        }
                        for (File file : files) {
                            if (file.isFile()) {
                                FileDoc fileDoc = new FileDoc(file, file.getName());
                                Map<DocGenerator, DocWriter> m = handleGen(fileDoc);
                                state.put(fileDoc, m);
                            } else if (file.isDirectory()) {
                                Files.walk(file.toPath()).map(Path::toFile).filter(File::isFile).forEach(docFile -> {
                                    String relativePath = file.toPath().relativize(docFile.toPath()).toString();
                                    FileDoc fileDoc = new FileDoc(docFile, relativePath);
                                    Map<DocGenerator, DocWriter> m = handleGen(fileDoc);
                                    state.put(fileDoc, m);
                                });
                            } else {
                                throw new IOException("Document " + file.getAbsolutePath() + " is not a file nor a dir");
                            }
                        }
                    }
                    sources.clear();
                }
                Set<String> processed = new HashSet<>();
                while (true) {
                    Optional<ElementResolution> opt = resolutions.values().stream().filter(res -> res.elt == null && !processed.contains(res.signature)).findFirst();
                    if (opt.isPresent()) {
                        ElementResolution res = opt.get();
                        processed.add(res.signature);
                        res.tryResolve();
                    } else {
                        break;
                    }
                }
            } else {
                state.forEach((doc, m) -> {
                    m.forEach((gen, w) -> {
                        String content = postProcess(gen.getName(), w.render());
                        write(gen, doc, content);
                    });
                });
            }
        } catch (Exception e) {
            Element reportedElt = (e instanceof DocGenException) ? ((DocGenException) e).element : null;
            String msg = e.getMessage();
            if (msg == null) {
                msg = e.toString();
            }
            e.printStackTrace();
            if (reportedElt != null) {
                processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, msg, reportedElt);
                if (reportedElt instanceof PackageElement) {
                    failures.put(((PackageElement) reportedElt).getQualifiedName().toString(), msg);
                } else {
                    throw new UnsupportedOperationException("not implemented");
                }
            } else {
                processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, msg);
            }
        }
    }
    return false;
}
Also used : TreePath(com.sun.source.util.TreePath) java.util(java.util) AbstractProcessor(javax.annotation.processing.AbstractProcessor) Files(java.nio.file.Files) URL(java.net.URL) LiteralTree(com.sun.source.doctree.LiteralTree) ErroneousTree(com.sun.source.doctree.ErroneousTree) StandardCharsets(java.nio.charset.StandardCharsets) JavaFileObject(javax.tools.JavaFileObject) SourceVersion(javax.lang.model.SourceVersion) Matcher(java.util.regex.Matcher) java.io(java.io) RoundEnvironment(javax.annotation.processing.RoundEnvironment) Diagnostic(javax.tools.Diagnostic) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment) DocTreeScanner(com.sun.source.util.DocTreeScanner) Pattern(java.util.regex.Pattern) javax.lang.model.element(javax.lang.model.element) Path(java.nio.file.Path) com.sun.source.doctree(com.sun.source.doctree) DocTrees(com.sun.source.util.DocTrees) Pattern(java.util.regex.Pattern)

Example 99 with Files

use of java.nio.file.Files in project gradle by gradle.

the class SimpleGeneratedJavaClassCompiler method compile.

/**
 * Compiles generated Java source files.
 *
 * @param srcDir where the compiler will output the sources
 * @param dstDir where the compiler will output the class files
 * @param classes the classes to compile
 * @param classPath the classpath to use for compilation
 */
public static void compile(File srcDir, File dstDir, List<ClassSource> classes, ClassPath classPath) throws GeneratedClassCompilationException {
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    if (compiler == null) {
        throw new GeneratedClassCompilationException("No Java compiler found, please ensure you are running Gradle with a JDK");
    }
    DiagnosticCollector<JavaFileObject> ds = new DiagnosticCollector<>();
    try (StandardJavaFileManager mgr = compiler.getStandardFileManager(ds, null, null)) {
        List<String> options = buildOptions(dstDir, classPath);
        List<File> filesToCompile = outputSourceFilesToSourceDir(srcDir, classes);
        if (dstDir.exists() || dstDir.mkdirs()) {
            Iterable<? extends JavaFileObject> sources = mgr.getJavaFileObjectsFromFiles(filesToCompile);
            JavaCompiler.CompilationTask task = compiler.getTask(null, mgr, ds, options, null, sources);
            task.call();
        } else {
            throw new GeneratedClassCompilationException("Unable to create output classes directory");
        }
    } catch (IOException e) {
        throw new GeneratedClassCompilationException("Unable to compile generated classes", e);
    }
    List<Diagnostic<? extends JavaFileObject>> diagnostics = ds.getDiagnostics().stream().filter(d -> d.getKind() == Diagnostic.Kind.ERROR).collect(Collectors.toList());
    if (!diagnostics.isEmpty()) {
        throwCompilationError(diagnostics);
    }
}
Also used : JavaCompiler(javax.tools.JavaCompiler) Files(java.nio.file.Files) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) ArrayList(java.util.ArrayList) JavaFileObject(javax.tools.JavaFileObject) StandardJavaFileManager(javax.tools.StandardJavaFileManager) List(java.util.List) Lists(com.google.common.collect.Lists) Diagnostic(javax.tools.Diagnostic) TreeFormatter(org.gradle.internal.logging.text.TreeFormatter) ClassPath(org.gradle.internal.classpath.ClassPath) DiagnosticCollector(javax.tools.DiagnosticCollector) ToolProvider(javax.tools.ToolProvider) JavaCompiler(javax.tools.JavaCompiler) Diagnostic(javax.tools.Diagnostic) IOException(java.io.IOException) JavaFileObject(javax.tools.JavaFileObject) StandardJavaFileManager(javax.tools.StandardJavaFileManager) DiagnosticCollector(javax.tools.DiagnosticCollector) File(java.io.File)

Example 100 with Files

use of java.nio.file.Files in project winery by eclipse.

the class CsarExporter method addManifest.

private String addManifest(DefinitionsChildId id, Map<CsarContentProperties, CsarEntry> refMap, ZipOutputStream out, Map<String, Object> exportConfiguration) throws IOException {
    String entryDefinitionsReference = CsarExporter.getDefinitionsPathInsideCSAR(repository, id);
    out.putNextEntry(new ZipEntry("TOSCA-Metadata/TOSCA.meta"));
    StringBuilder stringBuilder = new StringBuilder();
    // Setting Versions
    stringBuilder.append(TOSCA_META_VERSION).append(": 1.0").append("\n");
    stringBuilder.append(CSAR_VERSION).append(": 1.0").append("\n");
    stringBuilder.append(CREATED_BY).append(": Winery ").append(Environments.getInstance().getVersion()).append("\n");
    // Winery currently is unaware of tDefinitions, therefore, we use the
    // name of the service template
    stringBuilder.append(ENTRY_DEFINITIONS).append(": ").append(entryDefinitionsReference).append("\n");
    stringBuilder.append("\n");
    assert (refMap.keySet().stream().anyMatch(fileProperties -> fileProperties.getPathInsideCsar().equals(entryDefinitionsReference)));
    // Setting other files, mainly files belonging to artifacts
    for (Map.Entry<CsarContentProperties, CsarEntry> item : refMap.entrySet()) {
        final CsarEntry csarEntry = item.getValue();
        final CsarContentProperties fileProperties = item.getKey();
        stringBuilder.append(NAME).append(": ").append(fileProperties.getPathInsideCsar()).append("\n");
        String mimeType;
        if (csarEntry instanceof DocumentBasedCsarEntry) {
            mimeType = MimeTypes.MIMETYPE_XSD;
        } else if (csarEntry instanceof XMLDefinitionsBasedCsarEntry || csarEntry instanceof DefinitionsBasedCsarEntry) {
            mimeType = MimeTypes.MIMETYPE_TOSCA_DEFINITIONS;
        } else {
            mimeType = repository.getMimeType(((RepositoryRefBasedCsarEntry) csarEntry).getReference());
        }
        stringBuilder.append(CONTENT_TYPE).append(": ").append(mimeType).append("\n");
        if (exportConfiguration.containsKey(CsarExportConfiguration.INCLUDE_HASHES.name()) && Objects.nonNull(fileProperties.getFileHash())) {
            stringBuilder.append(HASH).append(": ").append(fileProperties.getFileHash()).append("\n");
        }
        if (exportConfiguration.containsKey(CsarExportConfiguration.STORE_IMMUTABLY.name()) && Objects.nonNull(fileProperties.getImmutableAddress())) {
            stringBuilder.append(IMMUTABLE_ADDRESS).append(": ").append(fileProperties.getImmutableAddress()).append("\n");
        }
        stringBuilder.append("\n");
    }
    String manifestString = stringBuilder.toString();
    out.write(manifestString.getBytes());
    out.closeEntry();
    return manifestString;
}
Also used : SortedSet(java.util.SortedSet) MimeTypes(org.eclipse.winery.common.constants.MimeTypes) LoggerFactory(org.slf4j.LoggerFactory) EncodingUtil(org.eclipse.winery.model.ids.EncodingUtil) DirectoryStream(java.nio.file.DirectoryStream) ServiceTemplateSelfServiceFilesDirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.ServiceTemplateSelfServiceFilesDirectoryId) SelfServiceMetaDataUtils(org.eclipse.winery.repository.backend.SelfServiceMetaDataUtils) SelfContainmentPackager(org.eclipse.winery.repository.backend.selfcontainmentpackager.SelfContainmentPackager) IdNames(org.eclipse.winery.model.ids.IdNames) DocumentBasedCsarEntry(org.eclipse.winery.repository.export.entries.DocumentBasedCsarEntry) VersionSupport(org.eclipse.winery.model.version.VersionSupport) Duration(java.time.Duration) Map(java.util.Map) TOSCA_META_VERSION(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.TOSCA_META_VERSION) GenericId(org.eclipse.winery.model.ids.GenericId) Util(org.eclipse.winery.repository.common.Util) Path(java.nio.file.Path) ZipEntry(java.util.zip.ZipEntry) CsarEntry(org.eclipse.winery.repository.export.entries.CsarEntry) RepositoryFileReference(org.eclipse.winery.repository.common.RepositoryFileReference) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) CREATED_BY(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.CREATED_BY) ENTRY_DEFINITIONS(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.ENTRY_DEFINITIONS) Collection(java.util.Collection) Constants(org.eclipse.winery.common.Constants) IMMUTABLE_ADDRESS(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.IMMUTABLE_ADDRESS) Options(org.eclipse.winery.model.selfservice.Application.Options) XMLDefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.XMLDefinitionsBasedCsarEntry) AccountabilityException(org.eclipse.winery.accountability.exceptions.AccountabilityException) Objects(java.util.Objects) CSAR_VERSION(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.CSAR_VERSION) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) IRepository(org.eclipse.winery.repository.backend.IRepository) RepositoryCorruptException(org.eclipse.winery.repository.exceptions.RepositoryCorruptException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) MediaTypes(org.eclipse.winery.repository.backend.constants.MediaTypes) HASH(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.HASH) NAME(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.NAME) RepositoryRefBasedCsarEntry(org.eclipse.winery.repository.export.entries.RepositoryRefBasedCsarEntry) ZipOutputStream(java.util.zip.ZipOutputStream) ApplicationOption(org.eclipse.winery.model.selfservice.ApplicationOption) AccountabilityManager(org.eclipse.winery.accountability.AccountabilityManager) DirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.DirectoryId) LocalDateTime(java.time.LocalDateTime) ServiceTemplateId(org.eclipse.winery.model.ids.definitions.ServiceTemplateId) DefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.DefinitionsBasedCsarEntry) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) ArtifactTemplateId(org.eclipse.winery.model.ids.definitions.ArtifactTemplateId) BackendUtils(org.eclipse.winery.repository.backend.BackendUtils) TArtifactReference(org.eclipse.winery.model.tosca.TArtifactReference) Application(org.eclipse.winery.model.selfservice.Application) DefinitionsChildId(org.eclipse.winery.model.ids.definitions.DefinitionsChildId) OutputStream(java.io.OutputStream) AccountabilityManagerFactory(org.eclipse.winery.accountability.AccountabilityManagerFactory) Logger(org.slf4j.Logger) Files(java.nio.file.Files) Environments(org.eclipse.winery.common.configuration.Environments) GitInfo(org.eclipse.winery.repository.GitInfo) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream) File(java.io.File) TArtifactTemplate(org.eclipse.winery.model.tosca.TArtifactTemplate) ExecutionException(java.util.concurrent.ExecutionException) NamespacesId(org.eclipse.winery.model.ids.admin.NamespacesId) Paths(java.nio.file.Paths) SelfServiceMetaDataId(org.eclipse.winery.repository.datatypes.ids.elements.SelfServiceMetaDataId) HashingUtil(org.eclipse.winery.common.HashingUtil) Git(org.eclipse.jgit.api.Git) InputStream(java.io.InputStream) CONTENT_TYPE(org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.CONTENT_TYPE) DocumentBasedCsarEntry(org.eclipse.winery.repository.export.entries.DocumentBasedCsarEntry) DocumentBasedCsarEntry(org.eclipse.winery.repository.export.entries.DocumentBasedCsarEntry) CsarEntry(org.eclipse.winery.repository.export.entries.CsarEntry) XMLDefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.XMLDefinitionsBasedCsarEntry) RepositoryRefBasedCsarEntry(org.eclipse.winery.repository.export.entries.RepositoryRefBasedCsarEntry) DefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.DefinitionsBasedCsarEntry) XMLDefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.XMLDefinitionsBasedCsarEntry) DefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.DefinitionsBasedCsarEntry) ZipEntry(java.util.zip.ZipEntry) Map(java.util.Map) HashMap(java.util.HashMap) XMLDefinitionsBasedCsarEntry(org.eclipse.winery.repository.export.entries.XMLDefinitionsBasedCsarEntry)

Aggregations

Files (java.nio.file.Files)243 IOException (java.io.IOException)210 Path (java.nio.file.Path)196 List (java.util.List)176 Collectors (java.util.stream.Collectors)154 Paths (java.nio.file.Paths)133 File (java.io.File)127 ArrayList (java.util.ArrayList)117 Map (java.util.Map)109 Set (java.util.Set)96 Collections (java.util.Collections)89 Arrays (java.util.Arrays)81 Stream (java.util.stream.Stream)77 HashMap (java.util.HashMap)74 HashSet (java.util.HashSet)58 InputStream (java.io.InputStream)55 Collection (java.util.Collection)55 Logger (org.slf4j.Logger)54 Pattern (java.util.regex.Pattern)53 Optional (java.util.Optional)51