public static ComponentId fromFileName(String fileName) {
        // Initial assumptions
        String id = fileName;
        Version version = null;
        ComponentId namespace = null;

        // Split out namespace, if any
        int at = id.indexOf("@");
        if (at > 0) {
            String newId = id.substring(0, at);
            namespace = ComponentId.fromString(id.substring(at + 1));
            id = newId;
        }

        // Split out version, if any
        int dash = id.lastIndexOf("-");
        if (dash > 0) {
            String newId = id.substring(0, dash);
            try {
                version = new Version(id.substring(dash + 1));
                id = newId;
            }
            catch (IllegalArgumentException e) {
                // don't interpret the text following the dash as a version
            }
        }

        // Convert dots in id portion back - this is the part which prevents us from
        id=id.replace(".","/");

        return new ComponentId(id,version,namespace);
    }
Creates an id from a file <b>first</b> name string encoded in the standard translation (see {@link #toFileName}).
<b>Note</b> that any file last name, like e.g ".xml" must be stripped off before handoff to this method.
component/src/main/java/com/yahoo/component/ComponentId.java