@Test public void testHandleDeserializerUpload() throws IOException { final Path tempDirectory = Files.createTempDirectory(null); final String mockContent = "test content"; final MockMultipartFile myFile = new MockMultipartFile( "data", "filename.txt", "text/plain", mockContent.getBytes(StandardCharsets.UTF_8) ); final String outputFilename = "MyUpload.jar"; final String expectedUploadedPath = tempDirectory.toString() + "/deserializers/" + outputFilename; final UploadManager uploadManager = new UploadManager(tempDirectory.toString()); final String result = uploadManager.handleDeserializerUpload(myFile, outputFilename); assertEquals("Has expected result filename", expectedUploadedPath, result); final byte[] contentBytes = Files.readAllBytes(new File(result).toPath()); final String contentString = new String(contentBytes, StandardCharsets.UTF_8); assertEquals("Contents are expected", mockContent, contentString); }
public String handleDeserializerUpload(final MultipartFile file, final String outFileName) throws IOException { return handleFileUpload(file, outFileName, getDeserializerUploadPath()); }
UploadManager { public String handleDeserializerUpload(final MultipartFile file, final String outFileName) throws IOException { return handleFileUpload(file, outFileName, getDeserializerUploadPath()); } }
UploadManager { public String handleDeserializerUpload(final MultipartFile file, final String outFileName) throws IOException { return handleFileUpload(file, outFileName, getDeserializerUploadPath()); } UploadManager(final String uploadPath); }
UploadManager { public String handleDeserializerUpload(final MultipartFile file, final String outFileName) throws IOException { return handleFileUpload(file, outFileName, getDeserializerUploadPath()); } UploadManager(final String uploadPath); String handleDeserializerUpload(final MultipartFile file, final String outFileName); String handleFilterUpload(final MultipartFile file, final String outFileName); String handleKeystoreUpload(final MultipartFile file, final String outFileName); boolean deleteKeyStore(final String keyStoreFile); }
UploadManager { public String handleDeserializerUpload(final MultipartFile file, final String outFileName) throws IOException { return handleFileUpload(file, outFileName, getDeserializerUploadPath()); } UploadManager(final String uploadPath); String handleDeserializerUpload(final MultipartFile file, final String outFileName); String handleFilterUpload(final MultipartFile file, final String outFileName); String handleKeystoreUpload(final MultipartFile file, final String outFileName); boolean deleteKeyStore(final String keyStoreFile);  }