### Question:
DiagnosticsReporter { public void dump( Set<String> classifiers, Path destination, DiagnosticsReporterProgress progress, boolean force ) throws IOException { List<DiagnosticsReportSource> sources = new ArrayList<>(); for ( DiagnosticsOfflineReportProvider provider : providers ) { sources.addAll( provider.getDiagnosticsSources( classifiers ) ); } for ( Map.Entry<String,List<DiagnosticsReportSource>> classifier : additionalSources.entrySet() ) { if ( classifiers.contains( "all" ) || classifiers.contains( classifier.getKey() ) ) { sources.addAll( classifier.getValue() ); } } Path destinationFolder = destination.getParent(); Files.createDirectories( destinationFolder ); estimateSizeAndCheckAvailableDiskSpace( destination, progress, sources, destinationFolder, force ); Map<String, Object> env = new HashMap<>(); env.put( "create", "true" ); env.put( "useTempFile", Boolean.TRUE ); URI uri = URI.create("jar:file:" + destination.toAbsolutePath().toUri().getRawPath() ); try ( FileSystem fs = FileSystems.newFileSystem( uri, env ) ) { progress.setTotalSteps( sources.size() ); for ( int i = 0; i < sources.size(); i++ ) { DiagnosticsReportSource source = sources.get( i ); Path path = fs.getPath( source.destinationPath() ); if ( path.getParent() != null ) { Files.createDirectories( path.getParent() ); } progress.started( i + 1, path.toString() ); try { source.addToArchive( path, progress ); } catch ( Throwable e ) { progress.error( "Step failed", e ); continue; } progress.finished(); } } }  void registerOfflineProvider( DiagnosticsOfflineReportProvider provider ); void registerSource( String classifier, DiagnosticsReportSource source ); void dump( Set<String> classifiers, Path destination, DiagnosticsReporterProgress progress, boolean force ); Set<String> getAvailableClassifiers(); void registerAllOfflineProviders( Config config, File storeDirectory, FileSystemAbstraction fs );  }### Answer:
@Test void dumpFiles() throws Exception { DiagnosticsReporter reporter = setupDiagnosticsReporter(); Path destination = testDirectory.file( "logs.zip" ).toPath(); reporter.dump( Collections.singleton( "logs" ), destination, mock( DiagnosticsReporterProgress.class), true ); verifyContent( destination ); }
@Test void supportPathsWithSpaces() throws IOException { DiagnosticsReporter reporter = setupDiagnosticsReporter(); Path destination = testDirectory.file( "log files.zip" ).toPath(); reporter.dump( Collections.singleton( "logs" ), destination, mock( DiagnosticsReporterProgress.class), true ); verifyContent( destination ); }