class Resource {

    private final URL url;

    public Resource(URL url) {
        this.url = url;
    }

    public Resource(Context ctx, String path) {
        url = ctx.getResource(path);
    }

    public URL toURL() {
        return url;
    }

    public URI toURI() throws URISyntaxException {
        return url != null ? url.toURI() : null;
    }

    public File toFile() throws URISyntaxException {<FILL_FUNCTION_BODY>}

}

        return url != null ? new File(url.toURI()) : null;
    
<no_super_class>