scifio/scifio — pull request #63 by hinerm (2013-09-16 00:13:52+00:00)
Title: Virtual handle

@ctrueden I decided to pull out the FakeHandle class to a new VirtualHandle, and just return this in LocationService.getHandle when making an NIOHandle fails.

I tried implementing this once in AbstractFormat, which I did like conceptually, but it created some awkward calls like:

Context -> FormatService -> getFormat(id) -> getHandle(id)..

so the Format instance is acting like a service and you have to provide the id twice.

I know this changeset means that Formats may fail oddly when the file doesn't exist but ultimately I think I like that more, and if needed we can add some checks in the components to check for these things. In the scope of LocationService I think it makes sense to create a VirtualHandle for now.

Let me know if you want me to refactor this though or if it doesn't fully resolve the OMEROFormat issues.