| 57 | } |
| 58 | |
| 59 | std::shared_ptr<io::BaseStream> ContentSession::read(const std::shared_ptr<ResourceClaim>& resourceId) { |
| 60 | // TODO(adebreceni): |
| 61 | // after the stream refactor is merged we should be able to share the underlying buffer |
| 62 | // between multiple InputStreams, moreover create a ConcatInputStream |
| 63 | if (managedResources_.find(resourceId) != managedResources_.end() || extendedResources_.find(resourceId) != extendedResources_.end()) { |
| 64 | throw Exception(REPOSITORY_EXCEPTION, "Can only read non-modified resource"); |
| 65 | } |
| 66 | return repository_->read(*resourceId); |
| 67 | } |
| 68 | |
| 69 | void ContentSession::commit() { |
| 70 | for (const auto& resource : managedResources_) { |