public String getFilename() {
        if (parsedFilename) {
            return filename;
        }
        String path = getPath();
        if (path == null) return null;

        path = removeParams(path);

        int lastSlash = path.lastIndexOf("/");

        String filename;
        if (lastSlash < 0) {
            //there is no slash, return the path, excluding params
            filename = path;
        } else if (lastSlash == path.length() - 1) {
            //the slash is the last character, there is no filename here
            filename = "";
        } else {
            filename = path.substring(lastSlash + 1);
        }
        this.parsedFilename = true;
        this.filename = filename;
        return filename;
    }
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