private Stream<Publication.Resource> getApplicationFilesAndFolders(Publication.Resource pubicationResource, Map<String, Integer> fileNamesTaken) {
        ResourceDescriptor resourceToPublish = ResourceDescriptorFactory.fromAnyUrl(pubicationResource.getSourceUrl(), encryption);
        if (resourceToPublish.getType() != ResourceTypes.APPLICATION) {
            return Stream.empty();
        }

        Application applicationToPublish = applicationService.getApplication(resourceToPublish).getValue();
        if (applicationToPublish.getApplicationTypeSchemaId() == null) {
            return Stream.empty();
        }

        String targetFolder = getTargetFolderForCustomAppFiles(pubicationResource.getTargetUrl(), encryption);

        List<ResourceDescriptor> applicationsOwnDescriptors = ApplicationTypeSchemaUtils.getFiles(configStore.get(), applicationToPublish, encryption, resourceService);

        Stream<Publication.Resource> folderDescriptors = applicationsOwnDescriptors.stream()
                .filter(ResourceDescriptor::isFolder)
                .flatMap(folder -> createResourcesForFolderFiles(folder, targetFolder, fileNamesTaken, pubicationResource.getAction()));

        Stream<Publication.Resource> fileDescriptors = applicationsOwnDescriptors.stream()
                .filter(descriptor -> !descriptor.isFolder())
                .map(file -> createResourceForStandaloneFile(file, targetFolder, fileNamesTaken, pubicationResource.getAction()));

        return Stream.concat(folderDescriptors, fileDescriptors);
    }
Leaves only required fields for listing.
server/src/main/java/com/epam/aidial/core/server/service/PublicationService.java