| 439 | } |
| 440 | |
| 441 | std::string |
| 442 | BundleContext::GetDataFile(std::string const& filename) const |
| 443 | { |
| 444 | if (!d) |
| 445 | { |
| 446 | throw cppmicroservices::IllegalStateException("The bundle context is no longer valid"); |
| 447 | } |
| 448 | |
| 449 | d->CheckValid(); |
| 450 | auto b = GetAndCheckBundlePrivate(d); |
| 451 | |
| 452 | std::string dataRoot = b->bundleDir; |
| 453 | if (!dataRoot.empty()) |
| 454 | { |
| 455 | if (!util::Exists(dataRoot)) |
| 456 | { |
| 457 | util::MakePath(dataRoot); |
| 458 | } |
| 459 | return dataRoot + util::DIR_SEP + filename; |
| 460 | } |
| 461 | return std::string(); |
| 462 | } |
| 463 | |
| 464 | std::vector<Bundle> |
| 465 | BundleContext::InstallBundles(std::string const& location, cppmicroservices::AnyMap const& bundleManifest) |