throw new IOException("No bundle associated with resource: " + url);
}
m_contentTime = bundle.getLastModified();
// Get the bundle's revisions to find the target revision.
BundleRevisions revisions = bundle.adapt(BundleRevisions.class);
if ((revisions == null) || revisions.getRevisions().isEmpty())
{
throw new IOException("Resource does not exist: " + url);
}
// Search for matching revision name.
for (BundleRevision br : revisions.getRevisions())
{
if (((BundleRevisionImpl) br).getId().equals(url.getHost()))
{
m_targetRevision = br;
break;
}
}
// If not found, assume the current revision.
if (m_targetRevision == null)
{
m_targetRevision = revisions.getRevisions().get(0);
}
// If the resource cannot be found at the current class path index,
// then search them all in order to see if it can be found. This is
// necessary since the user might create a resource URL from another