This is required to avoid creating the output if the migration cannot be performed for any reason.
Implementations of this class may be passed to {@link ResourceMigrator#migrate}. @mock.generate
8485868788899091929394
ByteArrayInputStream bais = new ByteArrayInputStream( inputData.getBytes()); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); DefaultInputMetadata meta = new DefaultInputMetadata(filename, true); resourceMigrator.migrate(meta, bais, new OutputCreator() { public OutputStream createOutputStream() { return baos; } }); assertEquals("", outputData, new String(baos.toByteArray()));
949596979899100101102103104
ByteArrayInputStream bais = new ByteArrayInputStream( inputData.getBytes()); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); InputMetadata meta = new DefaultInputMetadata(filename, true); resourceMigrator.migrate(meta, bais, new OutputCreator() { public OutputStream createOutputStream() { return baos; } }); assertEquals("", outputData, new String(baos.toByteArray()));
128129130131132133134135136137138
outputFile.getAbsolutePath()); reporter.reportNotification(note); } } else { InputStream in = new FileInputStream(inputFile); OutputCreator out = new FileOutputCreator(outputFile); try { InputMetadata inputMeta = frameworkFactory.createInputMetadata(path, true); migrator.migrate(inputMeta, in, out); } catch (ResourceMigrationException me) {