method.releaseConnection();
}
};
SeekableInputStream seekableStream =
new DefaultSeekableInputStream(closer, stream, true);
if(stream != null) {
// the mimeDiscoverer should not effect the Seekable stream
// and should restore its position but we mark it just in case.
String mimeType = null;
try {
seekableStream.mark();
mimeType = mimeDiscoverer.discoverMimeType(seekableStream);
} finally {
seekableStream.reset();
}
responseInfo = new DefaultRepresentation(
method,
mimeType,
cacheBuilder.build(),