Skip to content

Check for existence of http(s):// resources is broken #3274

@kasemir

Description

@kasemir

In #3246 we replaced this code for checking existence of a URL

final InputStream stream = openURL(resource_name);
stream.close();
return true;

in the ModelResourceUtil with

URL url = new URL(resource_name);
url.openConnection();
return true;

Turns out that breaks with our setup.
We still have some older *.opi files, and newer X.bob files.
An older action button might still try to open the older X.opi file, but the runtime first checks if there's already a newer X.bob version.

That functions fine with local files, but when using http(s) resources, a check for https://server/path/to/X.bob will now succeed even when the file doesn't actually exist on the web server?!
So then we try to actually open it, and fail.

With the previous openURL...close check, we would correctly detect if a file exists or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions