Skip to content

Allow to write to PathURLConnection #161

Description

@jsnps

Hey,

we ran into some issues in our unit tests, where EMF is trying to write to some URL in the jimfs filesystem.

The stack is the following:

PathURLConnection.getOutputStream() line: 130  =>  "protocol doesn't support output"
URIHandlerImpl.createOutputStream(URI, Map<?,?>) line: 154   
ExtensibleURIConverterImpl.createOutputStream(URI, Map<?,?>) line: 349   
PlatformResourceURIHandlerImpl.createOutputStream(URI, Map<?,?>) line: 498   
ExtensibleURIConverterImpl.createOutputStream(URI, Map<?,?>) line: 349   
ModelResourceImpl(ResourceImpl).save(Map<?,?>) line: 1041

To make EMF aware of jimfs, we register the top-level URI of a jimfs path into the ecore 'platform resource map' (essentially a map from Eclipse IProject -> URI) in the test setup:

EcorePlugin.getPlatformResourceMap().put("VdkWithVHub", URI.createURI(top.toUri().toString()));

It would be good, if the PathURLConnection could also implement the write protocol.

A trivial implementation fixed the issue for us: pull request

We would kindly ask to review the change and make suggestions if you see any violations of the protocol.

also see: #13 Obtaining a URL from a jimfs path

Thanks
Janik

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions