Source:
public String doExport(DataTransferExportModel exportModel) throws java.io.IOException { String zipLocation = new StringBuilder().append(System.getProperty("java.io.tmpdir")) .append(File.separator) .append(FILE_PATH) .append(File.separator) .append(EXPORT_FILE_NAME) .toString() .replace("\\", "/"); Predicate<Path> readmeFilter = p -> p.toString().toLowerCase().endsWith("readme.md"); Predicate<Path> datasetsFilter = def -> true; Predicate<Path> pagesFilter = page -> true; boolean exportNavigation = true; if (!exportModel.isExportAll()) { datasetsFilter = filterDatasets(exportModel.getDatasetDefinitions()); pagesFilter = filterPages(exportModel.getPages()); exportNavigation = exportModel.isExportNavigation(); } new File(zipLocation).getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(zipLocation); ZipOutputStream zos = new ZipOutputStream(fos); zipFileSystem(datasetsFS, zos, readmeFilter.or(datasetsFilter)); zipFileSystem(perspectivesFS, zos, readmeFilter.or(pagesFilter)); if (exportNavigation) { zipFileSystem(navigationFS, zos, p -> true); } else { zipFileSystem(navigationFS, zos, readmeFilter); } String componentsPath = externalComponentLoader.getExternalComponentsDir(); if (componentsPath != null) { zipComponents(Paths.get("file:" + componentsPath), zos, p -> true); } zipFile(createVersionFile(), "VERSION", zos); zos.close(); fos.close(); moveZipToFileSystem(zipLocation, systemFS); return new StringBuilder().append(SpacesAPI.Scheme.GIT) .append("://") .append(systemFS.getName()) .append(File.separator) .append(FILE_PATH) .append(File.separator) .append(EXPORT_FILE_NAME) .toString() .replace("\\", "/"); }

Target:
public String doExport(DataTransferExportModel exportModel) throws java.io.IOException { String zipLocation = new StringBuilder().append(System.getProperty("java.io.tmpdir")) .append(File.separator) .append(FILE_PATH) .append(File.separator) .append(EXPORT_FILE_NAME) .toString() .replace("\\", "/"); Predicate<Path> readmeFilter = p -> p.toString().toLowerCase().endsWith("readme.md"); Predicate<Path> datasetsFilter = def -> true; Predicate<Path> pagesFilter = page -> true; boolean exportNavigation = true; if (!exportModel.isExportAll()) { datasetsFilter = filterDatasets(exportModel.getDatasetDefinitions()); pagesFilter = filterPages(exportModel.getPages()); exportNavigation = exportModel.isExportNavigation(); } new File(zipLocation).getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(zipLocation); ZipOutputStream zos = new ZipOutputStream(fos); zipFileSystem(datasetsFS, zos, readmeFilter.or(datasetsFilter)); zipFileSystem(perspectivesFS, zos, readmeFilter.or(pagesFilter)); if (exportNavigation) { zipFileSystem(navigationFS, zos, p -> true); } else { zipFileSystem(navigationFS, zos, readmeFilter); } String componentsPath = externalComponentLoader.getExternalComponentsDir(); if (componentsPath != null) { zipComponents(Paths.get("file://" + componentsPath), zos, p -> true); } zipFile(createVersionFile(), "VERSION", zos); zos.close(); fos.close(); moveZipToFileSystem(zipLocation, systemFS); return new StringBuilder().append(SpacesAPI.Scheme.GIT) .append("://") .append(systemFS.getName()) .append(File.separator) .append(FILE_PATH) .append(File.separator) .append(EXPORT_FILE_NAME) .toString() .replace("\\", "/"); }