protected void expectPreprocessingIfNeeded() { if (doPreprocessing) { EasyMock.expect(stagingDirectoryFactory.get(PROXY)).andReturn(stagingDirectory); stagingDirectory.setup(); final OutputContext rawContext = EasyMock.createMock(OutputContext.class); EasyMock.expect(stagingDirectory.getOutputContext(String.format("%s.RAW", BASE))) .andReturn(rawContext); rawPopulator.get(rawContext); } else { EasyMock.expect(stagingDirectoryFactory.get(PROXY, PATH)).andReturn(stagingDirectory); } }
public void handleDownload(final String fileKey, final OutputStream outputStream) { final InputContext file = (InputContext) fileMap.remove(fileKey); file.get(outputStream); }