result.contentType(contentType);
} else {
contentType = mimeTypes.getMimeType(name);
}
ResponseStreams responseStreams = context
.finalizeHeaders(result);
if (item.isFormField()) {
System.out.println("Form field " + name
+ " with value " + Streams.asString(stream)
+ " detected.");
} else {
System.out.println("File field " + name
+ " with file name " + item.getName()
+ " detected.");
// Process the input stream
ByteStreams.copy(stream,
responseStreams.getOutputStream());
}
}
}