public static BundleEntry fromString()

in plugins/org.apache.karaf.eik.felix/src/main/java/org/apache/karaf/eik/felix/internal/BundleEntry.java [101:139]


    public static BundleEntry fromString(String s) {
        String candidateBundle;
        String startComponent;

        final int at = s.indexOf('@');
        if (at != -1) {
            candidateBundle = s.substring(0, at);
            startComponent = s.substring(at + 1);
        } else {
            candidateBundle = s;
            startComponent = "";
        }

        URL u = null;
        try {
            u = new URL(candidateBundle);
        } catch (MalformedURLException e) {
            // Do nothing as this is acceptable for a simple bundle
        }

        final BundleEntry entry;
        if (u == null) {
            entry = new BundleEntry(candidateBundle);
        } else {
            entry = new BundleEntry.UrlBundleEntry(u);
        }

        if (startComponent.length() > 0) {
            final int colon = startComponent.indexOf(':');
            if (colon == -1) {
                entry.startLevel = startComponent;
            } else {
                entry.startLevel = startComponent.substring(0, colon);
                entry.autostart = startComponent.substring(colon + 1);
            }
        }

        return entry;
    }