In working on Tika-1294, I thought that I'd try adding the following to
TikaCoreProperties:
public static final Property EMBEDDED_RESOURCE_TYPE =
Property.internalClosedChoise("embedded_resource_type",
new String[]{"attachment", "inline"});
When I run this:
Property attach = TikaCoreProperties.EMBEDDED_RESOURCE_TYPE;
Metadata m = new Metadata();
m.add(attach, "blah");
m.set(attach, "blah");
I don't get an exception. Should metadata be throwing an exception when a user
tries to set a value that isn't in the closed set? Or, am I misunderstanding
the purpose of closed choice?
Thank you.
Best,
Tim