public String getExtension() {
        if (parsedExtension) {
            return extension;
        }
        String filename = getFilename();
        if (filename == null) return null;

        int lastDotPos = filename.lastIndexOf(".");

        String extension;
        if (lastDotPos < 0) {
            //there is no ".", there is no extension
            extension = null;
        } else if (lastDotPos == filename.length() - 1) {
            //the "." is the last character, there is no extension
            extension = null;
        } else {
            extension = filename.substring(lastDotPos + 1);
        }
        this.parsedExtension = true;
        this.extension = extension;
        return extension;
    }
Returns the <i>rest</i> of this uri, that is what is following the host or port.
This is path, query and fragment as defined in RFC 2396. Returns an empty string
if this uri has no rest.
vespajlib/src/main/java/com/yahoo/net/URI.java