@Test public void testZipFilesEmpty() throws IOException { Path zipFile = processor.zipFiles(Collections.emptyList(), "invalid"); assertThat(readFilesFromZip(zipFile)).isEmpty(); }
Path zipFiles(List<SmartlingFile> files, String name) throws IOException { Path tmpDir = Files.createTempDirectory(name); for (SmartlingFile file : files) { Path filePath = Paths.get(tmpDir.toString(), file.getFileName()); Files.createDirectories(filePath.getParent()); Files.write(filePath, file.getFileContent().getBytes(StandardCharsets.UTF_8)); } return zipDirectory(tmpDir); }
SmartlingResultProcessor { Path zipFiles(List<SmartlingFile> files, String name) throws IOException { Path tmpDir = Files.createTempDirectory(name); for (SmartlingFile file : files) { Path filePath = Paths.get(tmpDir.toString(), file.getFileName()); Files.createDirectories(filePath.getParent()); Files.write(filePath, file.getFileContent().getBytes(StandardCharsets.UTF_8)); } return zipDirectory(tmpDir); } }
SmartlingResultProcessor { Path zipFiles(List<SmartlingFile> files, String name) throws IOException { Path tmpDir = Files.createTempDirectory(name); for (SmartlingFile file : files) { Path filePath = Paths.get(tmpDir.toString(), file.getFileName()); Files.createDirectories(filePath.getParent()); Files.write(filePath, file.getFileContent().getBytes(StandardCharsets.UTF_8)); } return zipDirectory(tmpDir); }  }
SmartlingResultProcessor { Path zipFiles(List<SmartlingFile> files, String name) throws IOException { Path tmpDir = Files.createTempDirectory(name); for (SmartlingFile file : files) { Path filePath = Paths.get(tmpDir.toString(), file.getFileName()); Files.createDirectories(filePath.getParent()); Files.write(filePath, file.getFileContent().getBytes(StandardCharsets.UTF_8)); } return zipDirectory(tmpDir); }  String processPush(List<SmartlingFile> files,
                              SmartlingOptions options); String processPushTranslations(List<SmartlingFile> files,
                                          SmartlingOptions options); }
SmartlingResultProcessor { Path zipFiles(List<SmartlingFile> files, String name) throws IOException { Path tmpDir = Files.createTempDirectory(name); for (SmartlingFile file : files) { Path filePath = Paths.get(tmpDir.toString(), file.getFileName()); Files.createDirectories(filePath.getParent()); Files.write(filePath, file.getFileContent().getBytes(StandardCharsets.UTF_8)); } return zipDirectory(tmpDir); }  String processPush(List<SmartlingFile> files,
                              SmartlingOptions options); String processPushTranslations(List<SmartlingFile> files,
                                          SmartlingOptions options);  }