// Create a version of the input which we can read multiple times.
// This is required because the content recognisers and the first step
// may all need to read the input data. Note that currently the
// implementation is very simple and reads the entire input into a
// byte array. Improving this implementation may speed the performance.
RestartInputStream restartInput = new RestartInputStream(input);
// Ask the resource recogniser to see if can recognise the input
// resource. This will throw an exception if we get duplicate matches
// as that indicates an error in the configuration which must be solved
// before we migrate30 the resource in question.
Match match = resourceIdentifier.identifyResource(meta,
restartInput);
// Restart the input since the recogniser will have already
// consumed it.
restartInput.restart();
// If we found a recognition match...
if (match != null) {
// ... then try and run the migration using the match.