ModeShape/modeshape — pull request #774 by rhauch (2013-04-05 14:48:41+00:00)
Title: MODE-1882 Corrected file system connector's use of binary values 

The file system connector was using the (built-in) UriBinaryValue class for its binary value objects. However, the DocumentTranslator was not handling this particular BinaryValue subclass, so the UriBinaryValue instances were merely written as stored BinaryValue instances. Thus, when reading content via the connector, the DocumentTranslator had only the SHA1 and size and thus created a StoredBinaryValue. The result was that the Binary value would resolve its content from the BinaryStore.

A test case was added to replicate the problem.

With this change, the UriBinaryValue extends the abstract ExternalBinaryValue class, which is handled by the DocumentTranslator and which is already used by the Git connector with GitBinaryValue. However, a few changes were required so that ExternalBinaryValue distinguished between the connector-specific "id" and the SHA-1 binary key. (These are the same for the Git connector, but the file system connector needs to use a URL for the "id".)

The test case passes with these changes.