[jboss-cvs] JBossAS SVN: r96362 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 13 10:43:01 EST 2009
Author: thomas.diesler at jboss.com
Date: 2009-11-13 10:43:00 -0500 (Fri, 13 Nov 2009)
New Revision: 96362
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
Log:
javadoc
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-11-13 15:40:44 UTC (rev 96361)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-11-13 15:43:00 UTC (rev 96362)
@@ -38,8 +38,11 @@
import org.osgi.framework.Version;
/**
- * An abstraction of a bundle
+ * Primitive access to bundle meta data and root virtual file.
*
+ * The bundle info can be constructed from various locations.
+ * If that succeeds, there is a valid OSGi Manifest.
+ *
* @author thomas.diesler at jboss.com
* @since 16-Oct-2009
*/
@@ -86,11 +89,17 @@
}
}
+ if (url == null)
+ throw new IllegalArgumentException("Cannot obtain root url from: " + location);
+
return new BundleInfo(toVirtualFile(url), location);
}
public static BundleInfo createBundleInfo(URL url)
{
+ if (url == null)
+ throw new IllegalArgumentException("Null root url");
+
return new BundleInfo(toVirtualFile(url), url.toExternalForm());
}
@@ -114,16 +123,8 @@
// Derive the location from the root
if (location == null)
- {
- try
- {
- location = rootURL.toExternalForm();
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Cannot obtain URL from: " + rootFile);
- }
- }
+ location = rootURL.toExternalForm();
+
this.location = location;
symbolicName = getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
@@ -204,7 +205,7 @@
}
catch (IOException e)
{
- throw new IllegalArgumentException("Invalid bundle url=" + url, e);
+ throw new IllegalArgumentException("Invalid root url: " + url, e);
}
}
More information about the jboss-cvs-commits
mailing list