// Upload the file contents, if still not uploaded
ChecksumStatus status = site.getChecksums().get(md5);
if (status.needsUpload()) {
api.uploadContent(status.getUrl(), content);
}
Sandbox sandbox = api.commitSandbox(site.getSandboxId(), true);
assertTrue(sandbox.isCompleted(), "Sandbox should be completed after uploading");
} catch (RuntimeException e) {
api.commitSandbox(site.getSandboxId(), false);
fail("Could not upload content", e);
}