}
}
private void verifyAndInsertLooseObject(final AnyObjectId id,
final byte[] compressed) throws IOException {
final ObjectLoader uol;
try {
uol = UnpackedObject.parse(compressed, id);
} catch (CorruptObjectException parsingError) {
// Some HTTP servers send back a "200 OK" status with an HTML
// page that explains the requested file could not be found.
// These servers are most certainly misconfigured, but many
// of them exist in the world, and many of those are hosting
// Git repositories.
//
// Since an HTML page is unlikely to hash to one of our loose
// objects we treat this condition as a FileNotFoundException
// and attempt to recover by getting the object from another
// source.
//
final FileNotFoundException e;
e = new FileNotFoundException(id.name());
e.initCause(parsingError);
throw e;
}
final int type = uol.getType();
final byte[] raw = uol.getCachedBytes();
if (objCheck != null) {
try {
objCheck.check(type, raw);
} catch (CorruptObjectException e) {
throw new TransportException(MessageFormat.format(JGitText.get().transportExceptionInvalid